From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 863E2C71148 for ; Fri, 18 Aug 2023 13:19:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377056AbjHRNSL (ORCPT ); Fri, 18 Aug 2023 09:18:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377048AbjHRNSH (ORCPT ); Fri, 18 Aug 2023 09:18:07 -0400 Received: from out-56.mta0.migadu.com (out-56.mta0.migadu.com [IPv6:2001:41d0:1004:224b::38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 639D926A5 for ; Fri, 18 Aug 2023 06:18:05 -0700 (PDT) Message-ID: <0e29059a-7f1c-523d-c3ec-e17bbc094af9@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1692364680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ufH4xMINH3kgJO/umN8yv91M824TLqg7bgQ+FUca9Fo=; b=sJ7r9dDI4XYaWbJOKsWltKC+taKM1qt22d01Fly83JDy2qGD7a8zkE398nBXSpSis2p8rn O1VLhesD19iOZEpEHqi+qkcm/0JomvjWLZ4jTYRnL9eYDVABhkfFdEB45wNWTwinwyH/pX kCY/6LIO089ld7l/uMrXurDbdqsQHq0= Date: Fri, 18 Aug 2023 21:17:32 +0800 MIME-Version: 1.0 Subject: Re: [PATCH] sched/fair: Fix cfs_rq_is_decayed() on !SMP Content-Language: en-US To: Vincent Guittot Cc: mingo@redhat.com, peterz@infradead.org, ycliang@andestech.com, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, zhouchengming@bytedance.com, linux-kernel@vger.kernel.org References: <20230818113537.2231129-1-chengming.zhou@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/8/18 20:25, Vincent Guittot wrote: > On Fri, 18 Aug 2023 at 13:37, wrote: >> >> From: Chengming Zhou >> >> We don't need to maintain per-queue leaf_cfs_rq_list on !SMP, since >> it's used for cfs_rq load tracking & balance on SMP. >> >> But sched debug interface use it to print per-cfs_rq stats, which >> maybe better to change to use walk_tg_tree_from() instead. >> >> This patch just fix the !SMP version cfs_rq_is_decayed(), so the >> per-queue leaf_cfs_rq_list is also maintained correctly on !SMP, >> to fix the warning in assert_list_leaf_cfs_rq(). >> >> Fixes: 0a00a354644e ("sched/fair: Delete useless condition in tg_unthrottle_up()") >> Reported-by: Leo Liang >> Signed-off-by: Chengming Zhou >> --- >> kernel/sched/fair.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index a80a73909dc2..00ef7e86a95b 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -4654,6 +4654,8 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) >> >> static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) >> { >> + if (cfs_rq->load.weight) >> + return false; >> return true; > > Why not : > > return !(cfs_rq->nr_running); > > The above seems easier to understand although I agree that both do the > same thing at the end > Yes, this is better. Thanks.