From patchwork Thu Feb 23 19:10:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 61053 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp484338wrd; Thu, 23 Feb 2023 11:13:19 -0800 (PST) X-Google-Smtp-Source: AK7set8S1mUfYzdTrRN4i1tD6ubDgGf9S0gzyCRHORdOjGVCxU0d5XoFVZpvi5oGImapi7Q4q5cu X-Received: by 2002:a17:906:105e:b0:89a:8238:3323 with SMTP id j30-20020a170906105e00b0089a82383323mr18561474ejj.6.1677179598868; Thu, 23 Feb 2023 11:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677179598; cv=none; d=google.com; s=arc-20160816; b=hdzMjKsDFC77oiIdD2AFlFqXihokaCuyV7jZJ2ph8uB/j30lDlmDgbrwiRAk7qMa5Q rYSEf89xdUKxIM5I0rUj1cbxR731SgXGJodI6lYksCDeJFGtmAp2ifZJLQJ21uXjWYg5 9GFGLomSnhvunX6kivvhAH+wT9ebY6L5Cf48m+noE2DY3Yb/ZEyNFx+GRMKuWaMZKRK+ q+nmHv99jFBBYYAzWRRZ1ZzyXFaJ04SB6xOzKBURFfUU5XtNVp7X4/38Fc3PQvVMT47u NDKjIGINKgMNvmIUSk+w0dXfr2hyBmoUiwJentWo7jrISYIKxDQOadkTmT2q3afIL47z fRBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jFfq5teius6pAK1nmf1oSiYVaS3V8Wiqx9qF8KZNMCQ=; b=OR6520qtPjVMymQ4z8BAk2Xq3CwdXYk/uTv3pitRTa+b9hlud0lFEvfL2mUOaDxB8O YY1rKb+229jVeKpBfU772L3Ufn9q5D03tNUb/lq5vhFfjwD67VgeGM9SveRo9BE4nARX Eb3OxyfRDeMggkJG7jAmm8oN1CaNoPcN4kkwK7hVVocBw9VZwqDUP3A23qbR0zOoyFHP Zh3jtqosyIqpuwsaqahDgjNNWTd7y6Zlaul9qPhF5YlvEjxkkFCXcmalZuI1zS0oci6J EV4p1SfoRoWj4wPsaZkKZJNDu4PxWEQgLSgfSpErrR1CF9Q9t134pwPahE7Zw1PrUpzn auuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MJINS6Eh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c24-20020a17090620d800b008dd40fa813esi12149116ejc.546.2023.02.23.11.12.55; Thu, 23 Feb 2023 11:13:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MJINS6Eh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231725AbjBWTLg (ORCPT + 99 others); Thu, 23 Feb 2023 14:11:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbjBWTLR (ORCPT ); Thu, 23 Feb 2023 14:11:17 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFF7C54A04 for ; Thu, 23 Feb 2023 11:10:56 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id bo30so10996155wrb.0 for ; Thu, 23 Feb 2023 11:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jFfq5teius6pAK1nmf1oSiYVaS3V8Wiqx9qF8KZNMCQ=; b=MJINS6Ehzxb0sA/shHfydBxkVARhkb5euAB6EGVMRuXxdAsAG6pDXdb4flSMzFT+yY PRjYJgKcy2c1kAx+kPy8dM5434vOLqdKjuKNeHCfiB8RKQbmGwyIuo4Ot0oXQb7muZ+l ZWC/DmvpqT63kO80J2s1A6myyM17DfUAmx3G55JMJo00DO8RkBo79sMzI6rv3ETm/bSg MZA8gNYLVzi9ZMwaLPg4IFzSrFXLkNnJk18xeVlUlJLothZxzfx19MCHKH5vD1Xot+6E jEnLaGltetRClluH4JSZ/6EniN60YkdoFAN5xk4I3XztP6jpTyMUAPpAM8IJgGi3E8Kx DmXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jFfq5teius6pAK1nmf1oSiYVaS3V8Wiqx9qF8KZNMCQ=; b=iOTAHYCC3oSJCTULAiKoQTNBmqnb8wBib0QfAykb7AmA4Seag0ZYeZISMfIM2b0Kxj cvgM7g5niesYIfDklDxSQksKObN91IlZ5J+9pH1BH/yILOFJWrZ9CW4PAlDNrWaLMumf a+u/yZBpIqB4wf/lV6olUFpJUy0flqwPB54bWUoxrpWkjmSY6NykhkTNrNneR2BEEiw3 H8w9hTx6/c5ZgjMKiiDwWmesSy5ykmu/VC5nnSTbGpiN5zCGjdGRt1lAySTdNi5bQKdK duivXXOxNQOO7LzkAgru5yk89sON+0yP/fT68lK5dzSZsRKAXj/HuvF6kW9GB2Y/ohNc NPKw== X-Gm-Message-State: AO0yUKVXFiwEl/xEDjbKgANLdW2txFh4AnrK3L+VL/oEwJNTlUcmVOtV akjl/QNy7GmwvmywGPuMTps9pQ== X-Received: by 2002:adf:e412:0:b0:2c7:148c:b04f with SMTP id g18-20020adfe412000000b002c7148cb04fmr2398501wrm.37.1677179455369; Thu, 23 Feb 2023 11:10:55 -0800 (PST) Received: from vingu-book.. ([2a01:e0a:f:6020:a6f0:4ee9:c103:44cb]) by smtp.gmail.com with ESMTPSA id k2-20020adff282000000b002c6e8cb612fsm9844481wro.92.2023.02.23.11.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 11:10:54 -0800 (PST) From: Vincent Guittot To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, parth@linux.ibm.com, lizefan.x@bytedance.com, hannes@cmpxchg.org, cgroups@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org Cc: tj@kernel.org, qyousef@layalina.io, chris.hyser@oracle.com, patrick.bellasi@matbug.net, David.Laight@aculab.com, pjt@google.com, pavel@ucw.cz, qperret@google.com, tim.c.chen@linux.intel.com, joshdon@google.com, timj@gnu.org, kprateek.nayak@amd.com, yu.c.chen@intel.com, youssefesmat@chromium.org, joel@joelfernandes.org, Vincent Guittot Subject: [PATCH v11 7/8] sched/core: Support latency priority with sched core Date: Thu, 23 Feb 2023 20:10:40 +0100 Message-Id: <20230223191041.577305-8-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230223191041.577305-1-vincent.guittot@linaro.org> References: <20230223191041.577305-1-vincent.guittot@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758650275057431516?= X-GMAIL-MSGID: =?utf-8?q?1758650275057431516?= Take into account wakeup_latency_gran() when ordering the cfs threads. Signed-off-by: Vincent Guittot Tested-by: K Prateek Nayak --- kernel/sched/fair.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index dc7570f43ebe..125a6ff53378 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11949,6 +11949,9 @@ bool cfs_prio_less(const struct task_struct *a, const struct task_struct *b, delta = (s64)(sea->vruntime - seb->vruntime) + (s64)(cfs_rqb->min_vruntime_fi - cfs_rqa->min_vruntime_fi); + /* Take into account latency offset */ + delta -= wakeup_latency_gran(sea, seb); + return delta > 0; } #else