From patchwork Fri Jan 13 14:12:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 43326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp293908wrt; Fri, 13 Jan 2023 06:17:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXusPsshtUcqzVI8OEKobpvjf1av9crC5wM4uKiuDVaMsk0EEjEFJSUVw1XC7/cGvzX1BhtJ X-Received: by 2002:a17:906:6892:b0:7c1:7010:f413 with SMTP id n18-20020a170906689200b007c17010f413mr3266701ejr.19.1673619459134; Fri, 13 Jan 2023 06:17:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673619459; cv=none; d=google.com; s=arc-20160816; b=0HMZ0BdRaacFKC7KuD0Dtc6L7Kvh7DzXHx99wYs+UVX4HUnDFKuzwr/5tVvt9tWliC HxdCbMjFGtIVA5RK0JvB+dAPJKXOia60YOF3vprwE6fpJ6ALImGECPvjbIGOOHYam0ye F5jBdTCLmem6fQjDV/SZS7oRm+XdX2+a+e4M8V/O1o6ilm1PbmgWaFYSP0PzivNpbpsL tvf7MpFK2ZRVx+1/ZLwU70ubYTyTxZNr8ryfS+UepsCS0FWYyZ9/wMCt5uhSppgEgVV3 /4qYX2HOhpXB8xQ6aMr7kzW8PXkvEcYlPXK0JzK3YLyWvM3ebEfsHyzcFF8nhXI/G/gZ z4Kg== 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=V6TGebPqxsiNn0n5diQ98jmCY4ZYb1DFPf0O/f9N2dY=; b=TANuqxb5OiUrA+fCu8VMckicI6Ji0POdBHsIz9vfu4pcP3u4XFL9QwO0VMBgBMJDKz Qkiq/Y752X97PTHilAQZ9W9Xh8TaFYRJ39XVVcwUpXyRA5gW4fBcUCIaSfI9bHKhqYsT SlBA8qq6iRt4SzPpeQHF4PIOaIP3HW3LXHCXTATX/U3TrzcIwl/CWpvE5DUuzt8nl23v +Nf2RQHFWE7v7sEybKUQb7rJgGuOyWdL2U7YsEHRqHEBuJEqJNGuwPH3KtLg9VMmCm9o i3H8281mSXCmAzMvgScwS2frjVPuTglfjlCy8oAm8WYj5qLBa4RTi8oL6vmdDJNsa94I D8Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kyoXFhhH; 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 hc41-20020a17090716a900b007c0dcc62e49si26023476ejc.56.2023.01.13.06.17.15; Fri, 13 Jan 2023 06:17:39 -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=kyoXFhhH; 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 S240603AbjAMOPr (ORCPT + 99 others); Fri, 13 Jan 2023 09:15:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242056AbjAMONx (ORCPT ); Fri, 13 Jan 2023 09:13:53 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CD6E6A0F6 for ; Fri, 13 Jan 2023 06:12:49 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id h16so21184469wrz.12 for ; Fri, 13 Jan 2023 06:12:49 -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=V6TGebPqxsiNn0n5diQ98jmCY4ZYb1DFPf0O/f9N2dY=; b=kyoXFhhH4LSSWG6wMnAiaJ07jZSSGb0HZosWr9qzMojEznxN8iqtffNopToVMH/hUL HSaY1Cobj6yL8RFFk3xyrySF23tDrhRt8LAziuIYTh00/5o47whlA/ZFBFM9ylDKTxFb 9EFinVeA81cLatWd6SqRGbpWGmlkmVG8EZed4HEvr+AN0C2rW8x4chbzfrnIS54JyJ6I Qbm/O6OMzFBNLWTO+oMb7JJhCWtZCEJCnmTlUCFxMNkAiUK2rwHwiU60qPQhW6lbzFyp +lDDdKUk9x57PDc9PGqF9Kmc9FzBaQJdyWVIrUZK4jp/KaNKJubP3jBIDRjMvoCUz+D4 rAyw== 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=V6TGebPqxsiNn0n5diQ98jmCY4ZYb1DFPf0O/f9N2dY=; b=k82yvB5Xxw/6RTpk12h6EeC4qlcphnng6mLF896j1r9rDA/bPtvD4iKcePwz4ThK4z 6q8mvTJCCgecbzULzNVFMrigrsNzRADSSmBKJthhCK+yDgngJR4rGo4jw0J04NNTxsAp lWjeyCuBpH/KfX/dJh8bM55dguBD36HlXl9SA+0lwRACKVFT0wm3fYnSAAhMQl5eoJhs RPn1KnmLPcYZrh40Bn0oo9YZEZTKjYSd0EfHu5d9Dk27v2O9oeW+KcfBuu45qqhfBGuH M+9SmhGar71lgospG2886DRpH4VyhYMl913B9DjPDRWbP/a2Pb5cYLaIgXIclh2H5P9d 7ugA== X-Gm-Message-State: AFqh2krh/cHksp7Q7dIf05Qoy0Zfnb4Qq2Px0rnvLXrEFQlt4+dMZ+Vh WIgAvGKgcCXcRG0h1t7y6l/w/Q== X-Received: by 2002:a5d:4692:0:b0:2bb:e94c:fcbf with SMTP id u18-20020a5d4692000000b002bbe94cfcbfmr13297857wrq.52.1673619168889; Fri, 13 Jan 2023 06:12:48 -0800 (PST) Received: from vingu-book.. ([2a01:e0a:f:6020:1563:65bf:c344:661e]) by smtp.gmail.com with ESMTPSA id f7-20020a5d6647000000b002bbeb700c38sm13869919wrw.91.2023.01.13.06.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:12:48 -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, cgroups@vger.kernel.org Cc: qyousef@layalina.io, 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 v10 7/9] sched/core: Support latency priority with sched core Date: Fri, 13 Jan 2023 15:12:32 +0100 Message-Id: <20230113141234.260128-8-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141234.260128-1-vincent.guittot@linaro.org> References: <20230113141234.260128-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=unavailable 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?1754917198365179922?= X-GMAIL-MSGID: =?utf-8?q?1754917198365179922?= 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 80ad27ddb4a1..a4bfa03d096c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11971,6 +11971,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 prio */ + delta -= wakeup_latency_gran(sea, seb); + return delta > 0; } #else