From patchwork Fri Oct 28 07:36:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 12140 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp679796wru; Fri, 28 Oct 2022 00:43:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7IJtsiD+flHdwsZ1oVINb/CAkGdBV/ycm/+/6JWxjPMFfBqCAIHA0sGrQslS1i3bATAxh0 X-Received: by 2002:a17:907:a0c6:b0:7ad:a030:7499 with SMTP id hw6-20020a170907a0c600b007ada0307499mr1228719ejc.552.1666943010965; Fri, 28 Oct 2022 00:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666943010; cv=none; d=google.com; s=arc-20160816; b=yVptwPbgnhCqqwRGmXfCDXBlWbK38wHZ8utA3KSfNOy2TX6/5Mv6MinOnMXifrhcL+ 2Sr6f+7ALWdosYPoXxbDWhA10VQ84YhhlYk6kjNcUEPbL6KmCHk8N1BsJaDuvmMoz2AQ Ir7sG3t/JRt4Xnm8LJFTRgO89puvlP9Vo9mUUgcCX1XAUrRyl6qEt0QLVcN3pdXgjT1S Z7VD4mQrkyyoXNundRqvOlA08V1X3IcaXfChyKQBTVQfreIL2S7rXpdFOqALs3R2RCmZ V9VoB/Tf78I1/zO7gu8PUeq7xP+iB3jNwG/MVTfHFVu3P7A4OxYmXWpaTFFtPMzwStVa cH/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=BdpGOqqRR51x8v+WZgI/bsaGNfHn7spXAbo4XhwMNf4=; b=pqpvE2DP/VeiXL5IWLIBOWWQGRR5lKfmSqlHsTdqivGp8pQNssYMb+OBtw9bUVzEUo /HC2oFjudLH5gTvcC7XPt2LNcSRlONHvfOMH6kvdeXVpWK3lEuDWudLSglx6sGk7j78S I/ETQZ3DxwBn5jTGx7vGgtxGju+1wqos5LbeLWj3VW0o1rgcYni800wDPj1D6fNgAmtX tIwzgk8foM/+uMJd26A1V+Lbt91eUCRvrM7iRXTHnlhwixMQxt04VkAX+67+v0iauK8c hM4Scj9agd7YdwGTw7ONiuKmcm0gRfrI7uQiMPXcts742x1nxEh5+K9RuG9wDQsc12Wu OaHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qe09/nTv"; 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 f25-20020a50d559000000b00461ac01753fsi3811970edj.369.2022.10.28.00.43.07; Fri, 28 Oct 2022 00:43:30 -0700 (PDT) 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="qe09/nTv"; 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 S229473AbiJ1Hh0 (ORCPT + 99 others); Fri, 28 Oct 2022 03:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230232AbiJ1HhF (ORCPT ); Fri, 28 Oct 2022 03:37:05 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C0D1BC157 for ; Fri, 28 Oct 2022 00:37:03 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id l16-20020a05600c4f1000b003c6c0d2a445so2909270wmq.4 for ; Fri, 28 Oct 2022 00:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=BdpGOqqRR51x8v+WZgI/bsaGNfHn7spXAbo4XhwMNf4=; b=qe09/nTvE0G/K4zkvg/DsQq8oHH7SjmRLoGHceZha1Qm5MqWolIk7mFG0thT+nMLKF KmysZi86J4U/5hXr25vRhPcDCIKGkkN4zND+Y6vzOHSZIiS616i1X/GWi7nrmvq4ie7m lLtii7gv4j4T1PY82iCgfwruhI3BLqBkJDpGb11OxRWiYl3aCY0s/q0KJRN/tjm6C5gN 3voZULnWa+hrVgtCi0+hNUcAckmglcRPmebAzm21WrSsNcHebeMwX3ob8HJ8XM7ubRLs DYzs111nItJbuSSoUYYd+orcq/2ILdjTkCxJlJ4xOlJan/kuxb/YNFDB6+OI2htyxuDZ 1xXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=BdpGOqqRR51x8v+WZgI/bsaGNfHn7spXAbo4XhwMNf4=; b=7HEOvTEgpDQy4QZVWLSUyvaAbAjt7i2l39M5nLbnHFHuvVkm8LvZlrLaL6OS3q956b 1RKPYrDsDPbYA8EFr8+6cvgRECPot0vA2eBER02MKlp3ZGedQmcZGwjJCynlT8y06sni T0h5CiSoRRzIUFfVeidn5Kb+mql/11NM4wblT6KzzUgxhMg/KraENseCJ/R6tb/hCeMQ +XXW7ztGBEbHbMDkRXnRpaq+B5BYEPQtf/KXqN1CzTsaFxk2TDU0vToBl7k4ooILZV12 TJMHTndd5chHbzIeoSO7D3Y1Mo+cZ0AH5PWQu78HRhEFmohUXVCKhUGY5v9nc+XUpxsT HS2w== X-Gm-Message-State: ACrzQf2LndxuOztrLoN+FQMrQpseIBaWLrqc7tzEyalpVgqox0cY2psj z0m5m9SD3Pe05bw/v8qIfmJVchcDNcujlg== X-Received: by 2002:a7b:c341:0:b0:3c4:552d:2ea7 with SMTP id l1-20020a7bc341000000b003c4552d2ea7mr8571521wmj.82.1666942622585; Fri, 28 Oct 2022 00:37:02 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:c12b:b448:f0a9:83ef]) by smtp.gmail.com with ESMTPSA id j8-20020a05600c190800b003b47e8a5d22sm7783129wmq.23.2022.10.28.00.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 00:37:01 -0700 (PDT) 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 Cc: qais.yousef@arm.com, chris.hyser@oracle.com, patrick.bellasi@matbug.net, David.Laight@aculab.com, pjt@google.com, pavel@ucw.cz, tj@kernel.org, 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 v6 7/9] sched/core: Support latency priority with sched core Date: Fri, 28 Oct 2022 09:36:35 +0200 Message-Id: <20221028073637.31195-8-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221028073637.31195-1-vincent.guittot@linaro.org> References: <20221028073637.31195-1-vincent.guittot@linaro.org> 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?1747916434538424673?= X-GMAIL-MSGID: =?utf-8?q?1747916434538424673?= Take into account wakeup_latency_gran() when ordering the cfs threads. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9583936ce30c..a7372f80b1ea 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11439,6 +11439,9 @@ bool cfs_prio_less(struct task_struct *a, struct task_struct *b, bool in_fi) delta = (s64)(sea->vruntime - seb->vruntime) + (s64)(cfs_rqb->min_vruntime_fi - cfs_rqa->min_vruntime_fi); + /* Take into account latency prio */ + delta -= wakeup_latency_gran(sea, seb); + return delta > 0; } #else