From patchwork Fri Oct 28 07:36:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 12142 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp679881wru; Fri, 28 Oct 2022 00:43:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM676hWcSktj9DiH8YmWGUust4v6ScdmnfBVx0RCEasYckVtlXihBYArUR2hPFE7CRFNEHoo X-Received: by 2002:a05:6402:c4d:b0:457:99ec:1837 with SMTP id cs13-20020a0564020c4d00b0045799ec1837mr48893506edb.86.1666943026229; Fri, 28 Oct 2022 00:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666943026; cv=none; d=google.com; s=arc-20160816; b=cLW9FAKZtKwqApOEnFQwXutwYUAC3iXt8Z1uXw4FFIHL13TotKCcqvusMKoSJ15Qs4 jzuwtBsKRWI1dMj9fsbZJqCao6TuJSan9dFRMcgQKIh/SdGbrFtCBhfhitbVYYFFfWzR JWohB/CFToGpO2C/bqc9N5cjJ4jjiNZ2ua2UZ01arahhk/xjAxVRH40nYbkrC16kSH9m MmMkx/f6mOk9tjGwNz02v2xYxgMkwDjuPztP44/ijIhKxv8xHk0ca1KSa/zduNsOInIT QniS6y5aLeVTTXIuh5RESV/EnOsThw1b8QHNAiD58nA5Dg7vie2bgfEKeNZtcGQOJRrG Ruwg== 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=zy7QY6HAum4eocAiGxC3tA1yZA7zRnpZ3kdrW18hPm0=; b=hvgvprl9C5eLMZ3o6kRssoS9WnFhm/IrHitLt5XKgasifK43quLZaEp2ppllG9AkmS t+EwOujmH4BGyADc14EZG5yRHdLvK70S4uWX/z9uFA5IpKNy7juNssTt8ihTlKm42Sgj XHGD8v3lvrwG4vmPgFFej9QZ+RY0h54yj/c2syMP8EtuhIgTm8aTxam59wdyeZuLtomy 2bVJCpnslBACzoaGKcfa9gQSqnV7d5jss+qtKrSgI/5wUe25HVeJ6VGxflSmQ10JkVA2 WDUO3y04xLTzOq6fA7aTKKqoK2B5jI520X26kZdJBbCn1OQ6rf4cwUAm2li3zwX/BIWp n/gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VLe7YWFt; 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 qw34-20020a1709066a2200b0078da3cd3073si1876105ejc.628.2022.10.28.00.43.23; Fri, 28 Oct 2022 00:43:46 -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=VLe7YWFt; 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 S230264AbiJ1Hhr (ORCPT + 99 others); Fri, 28 Oct 2022 03:37:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230226AbiJ1HhP (ORCPT ); Fri, 28 Oct 2022 03:37:15 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A25921BE1D6 for ; Fri, 28 Oct 2022 00:37:09 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id z14so5830391wrn.7 for ; Fri, 28 Oct 2022 00:37:09 -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=zy7QY6HAum4eocAiGxC3tA1yZA7zRnpZ3kdrW18hPm0=; b=VLe7YWFtcwIvALbj2GLX0Md1taqlPqb82YAbGh6QGYJTtbgEU4+3dtSWNFLSgbx4yI Qcf+VVGUxYSdtKyLIa2gsj0R8gSwuvBup3mvo3kxxwRd5fG4iRv5/QX0+eL4DwnWTO4g MkD/YgWag9h/tQRxFb8J5LFYNcvMwxyE9LE8tZTH4g+mTPTiGSr1P6d6XPrbeVJtIV6x IElsLB2eVc/pEcwJctzSOAUEW6AnvJ7u46WxgstpyX6Gz5ztSRaaiSejyLA0uXfvZ0O9 PADRkkwSJ+bMoZ+wjjzRbzYZdOnJOr/n/2AOhr1eP/oJncvK5Ez2CuZkHMax1j+RWhzW n0mQ== 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=zy7QY6HAum4eocAiGxC3tA1yZA7zRnpZ3kdrW18hPm0=; b=durP6NWS6xyMHERg+qt48ojJXfGbBGYdh8MP9mLsPvkfi9AqikYDqLtifbbbRcIFK2 KOcaCrvOAgK8jWF55Lp5SEnh2HchnFuzLCHpOyuqIbsHHOSL7yXVO4+2rcX7MDu2vGmj 4xiKE3lIHDfbSZVpzhaWTWXaEMB+l4xSgPRWasFKO/9TvRUCfGhKM8qWzVxwB1YTzC3N WQ/k1YkezT3bOL1I8wZaolOI32B0k6c8AtNkiIZKD4SsGzPvFHUFx8CM08Sxrfmk2lll RO2BB6+B8VovrDpaiBxNo/IZYIXdf3ztQWNR+nGnFONmH4VGf6SgLLfQLl53JaUDsV7P GyDA== X-Gm-Message-State: ACrzQf2z4Z6Rp5vGutjc8I+PbgS3PpN0irzh5Vz6fOq2lLJ+N1K26CIB jItzwnDv+eZTfpyHoSjnxufiqg== X-Received: by 2002:adf:ec8a:0:b0:236:5b80:da83 with SMTP id z10-20020adfec8a000000b002365b80da83mr20949051wrn.509.1666942627666; Fri, 28 Oct 2022 00:37:07 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 00:37:06 -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 9/9] sched/fair: remove check_preempt_from_others Date: Fri, 28 Oct 2022 09:36:37 +0200 Message-Id: <20221028073637.31195-10-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?1747916451132416642?= X-GMAIL-MSGID: =?utf-8?q?1747916451132416642?= With the dedicated latency list, we don't have to take care of this special case anymore as pick_next_entity checks for a runnable latency sensitive task. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c28992b7d1a6..9a421b49dbfd 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5802,35 +5802,6 @@ static int sched_idle_cpu(int cpu) } #endif -static void set_next_buddy(struct sched_entity *se); - -static void check_preempt_from_others(struct cfs_rq *cfs, struct sched_entity *se) -{ - struct sched_entity *next; - - if (se->latency_offset >= 0) - return; - - if (cfs->nr_running <= 1) - return; - /* - * When waking from another class, we don't need to check to preempt at - * wakeup and don't set next buddy as a candidate for being picked in - * priority. - * In case of simultaneous wakeup when current is another class, the - * latency sensitive tasks lost opportunity to preempt non sensitive - * tasks which woke up simultaneously. - */ - - if (cfs->next) - next = cfs->next; - else - next = __pick_first_entity(cfs); - - if (next && wakeup_preempt_entity(next, se) == 1) - set_next_buddy(se); -} - /* * The enqueue_task method is called before nr_running is * increased. Here we update the fair scheduling stats and @@ -5917,15 +5888,14 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags) if (!task_new) update_overutilized_status(rq); - if (rq->curr->sched_class != &fair_sched_class) - check_preempt_from_others(cfs_rq_of(&p->se), &p->se); - enqueue_throttle: assert_list_leaf_cfs_rq(rq); hrtick_update(rq); } +static void set_next_buddy(struct sched_entity *se); + /* * The dequeue_task method is called before nr_running is * decreased. We remove the task from the rbtree and