Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1860663rwn; Fri, 16 Sep 2022 01:47:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4+cM97q6CH1Lyev3zpFF7Mh/+XaREPtRAx9Js2wdTRtjz5DqJfJe8Aft+0rV+fqL5wbDfJ X-Received: by 2002:a05:6a00:b41:b0:52f:59dc:75 with SMTP id p1-20020a056a000b4100b0052f59dc0075mr4264807pfo.33.1663318038739; Fri, 16 Sep 2022 01:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663318038; cv=none; d=google.com; s=arc-20160816; b=cBW+4XCkM5suGMdokVOvMhvvL0nfk0w7/eyA6HPGAvns9xZYOhKlCY2RVaAu4twugg wVKLjJMGvG25K6hS9TxTZCpCwfAQ9r58qJTJMPfazmweXazPur+hsR7ia33lxQnv+WGB gGgf+dMY8ml/Y6sQOSRgsAYuZC4BqJze7ZaAIOq6FUVbv2paXnt5T7sbWxfq5jMncRR4 sZINczK0XXsoq8qpAdYa46JhZKmBNBSarnbKQY56ST27X2u9n2Af0ZaQlNixcqxuEWSv q9+3Z08D9RyPVpNxdtqsCiNpHftGHZSy2K1gPulDuyLieGwzuQz/12r8MyRLwlziuM/6 xFMA== 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=ShOnvvH2vqswW8cX/k2qHv7+hfeakBkSeirHaU9mNjk=; b=Xn+vKrdUJyZSW6kDzpUP5SagCTOg3gnE3TH0m67LJQZSftyMG19DsrvD3nrbjy0eYH pa661tNcdIcL5LClkkhDf7VeLfvu3hKqBHi/Yw/A8GMGIyQiPSZOs5hgYNaYX0fqPb8s 7UhlnnToio/S8/FR6fkQMGnoH85Om/Me7RVoBYMy2RY66CRFjRI4hrIiD+ek8vkqz8sI 5A/I8pYFnhEcT2BRW2XVlsvNyDCIeEMuybvIR+aEmPDOX3QAeE9WV9aqLWgPH3nljnwD ofCFuObHY1pBCsH1ftpIaUF5sEHQ4vpxTEgwVptgNxPK598lnNGv8QAZ2dL4TJbQqTE5 MOOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nWn4K98s; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n15-20020a170902f60f00b0016cf48bd5cfsi20920174plg.78.2022.09.16.01.47.06; Fri, 16 Sep 2022 01:47:18 -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=nWn4K98s; 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 S230323AbiIPIEi (ORCPT + 99 others); Fri, 16 Sep 2022 04:04:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbiIPIDe (ORCPT ); Fri, 16 Sep 2022 04:03:34 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CC02A5717 for ; Fri, 16 Sep 2022 01:03:28 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id z12so16386313wrp.9 for ; Fri, 16 Sep 2022 01:03:28 -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; bh=ShOnvvH2vqswW8cX/k2qHv7+hfeakBkSeirHaU9mNjk=; b=nWn4K98smKU8rTj/exgiA9q/eWysrRh4iSpKFUaWG0C4NyUTRbNMuLCc0Q3aLBwiYf i6OQbis1h7HJR4LJo24ROd3I3jm611tEFi1nnu5pqIBMxlQmSF+6DFVvWZNfPp8FrUHf Qlstp+9BNYfdrpHHYgHB+wNvPAogmce7QW7KuR5EXFaAROXdktPNfNBmaSyTG7BJmo2j eKMaWr0iYcuq1SQkkY8t0E6Qbw/+cDtfK9ji2zNXZ0fMvL6tb4HBweI3Y2Ks8FkgxjBe PHmHaG6n2d6m1nTXRJJRl1sPzoQpkUVO+Z635W8cVsoCCZq9E7wioJSZskGE75Lxcunz GSyw== 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; bh=ShOnvvH2vqswW8cX/k2qHv7+hfeakBkSeirHaU9mNjk=; b=p7GYqv22+CTF8TNuPVPMEW1qdbcBlIAKOfwt+zWLFLlZdbAhNDq+/FH5POlXO/CjO9 iqxxvvNehYAlhfHtjRJfbV7FUjRp8WwSfZ/reKC//I/WMiKkGxngbdumt9X62YhgfqxE 7LqHRULJSJ9dQ4p9JRCjtQNo5IyEnOKUJ6I3rtQxHOz7e7oMxrEJ/QrVVI4mD82isIzy OwObjmx+V4tryNK0JtU74MWwxOw3wX2tpd9HtNVvJwpFC/E9qdxgEQDVBcMTsL5lZBer nQs9Vfl4vl995Rg/3sdGra7r+7V1Utvg+hup2RebY+cuwfBsjudQSE6V7OWBpwVuW609 on4A== X-Gm-Message-State: ACrzQf2rxm1JOz2fFlBZrTSacKnXKGjjntAX/g8uCg7w8UpqKVAl7a/F hsWWpKBZtXQftw5wFjpZYFJTpLL8JzNMzyVK X-Received: by 2002:adf:f8ca:0:b0:226:e456:1896 with SMTP id f10-20020adff8ca000000b00226e4561896mr2052765wrq.177.1663315406781; Fri, 16 Sep 2022 01:03:26 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:9ab:1164:827a:1548]) by smtp.gmail.com with ESMTPSA id c9-20020adffb49000000b00228dbf15072sm4418116wrs.62.2022.09.16.01.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 01:03:25 -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, valentin.schneider@arm.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, Vincent Guittot Subject: [PATCH v4 7/8] sched/core: support latency priority with sched core Date: Fri, 16 Sep 2022 10:03:04 +0200 Message-Id: <20220916080305.29574-8-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220916080305.29574-1-vincent.guittot@linaro.org> References: <20220916080305.29574-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 Take into account wakeup_latency_gran() when ordering the cfs threads. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6cc4f2a9725d..7563fb16aba1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11444,6 +11444,10 @@ 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 -- 2.17.1