Message ID | 20240130131708.429425-3-alexs@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1210173dyb; Tue, 30 Jan 2024 05:14:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIkG8iVpTCjMF587j6ZEQ55pPqhSDgW29prz8QktCSnTHzZaxLboV1ZwhPDQZzj9yuz/PT X-Received: by 2002:a05:620a:51d9:b0:783:d0f8:c5ba with SMTP id cx25-20020a05620a51d900b00783d0f8c5bamr7722804qkb.8.1706620494760; Tue, 30 Jan 2024 05:14:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706620494; cv=pass; d=google.com; s=arc-20160816; b=AfoyCGVeAERd3UwZX1atoxnFBFRUyiodIYJiSGpAGIpaFGO6JLGIvjYwIdJQ4Nfu2b xSjBMqkzUnqyx0VczsLoBfCaVU9j2GNl8G0Tg/6XF0RR2LgbvabRM7WU6veb32SnbFfa +GVD3c/tf+FjoOvENdqLzuVVI4yriw63wjtUPYg0kgLShxWv5rb3Hp8y1wruzZfCdobG kzc5r9wQiKR3Y0UYHhXSd5ekDeCEuVQoH/4iUQgJQoQVasaU38TPqrFrozhrNZtfLqzy 0S8YHWmUftqNrnbJtp7wNcKHXpKR9McdTzO85c2Jh6jKDIqdm0mCP+sL7svYk65N25I8 WIHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Nz5IWNaCLtxle2arfvAWM+KcsFMGi04e8HWFD5kjPeM=; fh=CH0OO+rsEMoKRW5HY96+2DQ466rE9ttKX9bm1c+/3Ro=; b=C2+GaKBfDD2vVMdcIdf+uP0CwjFI5hzhSxQQ6P1cWq1xMV1Y+AvZ+uUsdbzNhHHwHn 40gqNtBWBFwxLCrZ0YNiKuDK/UrM7umh74Vp58pESNoVYTsLOj35iMciuWqHY7shH/bc 1sKvt71o6XdNJb35KJgJxFT5Y6Kz2bwO1yf2UF+dCTahGj49a/3BEf27gzJr6TnOcCr6 6HA+3XSDWM/rSOFqTA+fhhN0YE2J7d0zLkX1Xjv5o5Kqn78ZNyGUGfC1sB+/k5pttgot 7pOP+9D1ki0710odk9qP+rV7Qx3obEFuiyA6rrvc3f17qWSpfTSKvP1k1O87ek97LQCN zcag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYZIrhXs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id br31-20020a05620a461f00b00783e73689e4si7550118qkb.315.2024.01.30.05.14.54 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 05:14:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYZIrhXs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8D28C1C2583B for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 13:14:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5A386DCEA; Tue, 30 Jan 2024 13:14:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oYZIrhXs" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3359E6BB5E for <linux-kernel@vger.kernel.org>; Tue, 30 Jan 2024 13:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706620463; cv=none; b=sKzmKby78639TpT3lkouhvX7T5Ev2QObRDPn7CEl290gj0DWyvzEXqPDPopjQQJQqOHpJrKVbVMLS/JdkT4TERr6z12/7xwc38zp58Eqh5+xXV2ysF6wTfvkKFsv/d9qdpBefPfeg9cQ87bnFSKEqJosH0N8bhX152LNGifFfNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706620463; c=relaxed/simple; bh=yCvjq75MG5lal2aoR5CJIjlQvsuAuYZd+/xwaBRiyWk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QlTzQ8zQ0uL7vZCRqBT3T1cAZJhPN4CsMD149I46zVHUW3xrbbLurm5fOI8duUlp4EyNCRHDW3Y+knp9fHNI10wtZGb/ETuuIc2ScYtNnaunjumnjxySETumf3a8VnJ8/JTkZZXZo1fobMmuyc0CUJzloVoXpooxml3SHrJznjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oYZIrhXs; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD65DC433F1; Tue, 30 Jan 2024 13:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706620462; bh=yCvjq75MG5lal2aoR5CJIjlQvsuAuYZd+/xwaBRiyWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oYZIrhXsCkivSFCFCcqxyVyfyBW5b32qzmemiHnXjllfQMguGWygoJfX/s3xJgKIQ Npk7xj+iJ3VRzPWbadCThqwUiEC4xHfb+VOHYVKE3Zfc47MmebtPd/xKLhzfIn5u2A +f3z9UIcYfOK/3kw/XFQ5W3LLxwtax9MhDdFCd6YaUNwNuWWeoOW8YQezXKyPPzDVA A9K255xR7tf19UwM89aIJQoIZmwNXTNVLNycEZMgdxOQJDObJn0yyeYqHCkA30dSub j49KSh4mkRQFetWdnR2Mr9dhYKM50Lh8lWT8ap0YJGSBBaK0rbhuPG2AtLr3M907tZ WpbT9c8ajIANA== From: alexs@kernel.org To: Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>, Juri Lelli <juri.lelli@redhat.com>, Vincent Guittot <vincent.guittot@linaro.org>, Dietmar Eggemann <dietmar.eggemann@arm.com>, Steven Rostedt <rostedt@goodmis.org>, Ben Segall <bsegall@google.com>, Daniel Bristot de Oliveira <bristot@redhat.com>, Valentin Schneider <vschneid@redhat.com>, linux-kernel@vger.kernel.org, ricardo.neri-calderon@linux.intel.com, sshegde@linux.ibm.com Cc: Alex Shi <alexs@kernel.org> Subject: [PATCH v2 3/6] sched/fair: cleanup sched_use_asym_prio Date: Tue, 30 Jan 2024 21:17:05 +0800 Message-ID: <20240130131708.429425-3-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240130131708.429425-1-alexs@kernel.org> References: <20240130131708.429425-1-alexs@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789521291536937321 X-GMAIL-MSGID: 1789521291536937321 |
Series |
[v2,1/6] sched/fair: add SD_CLUSTER in comments
|
|
Commit Message
alexs@kernel.org
Jan. 30, 2024, 1:17 p.m. UTC
From: Alex Shi <alexs@kernel.org> And simplify the one line code. No function change. Signed-off-by: Alex Shi <alexs@kernel.org> To: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> To: Valentin Schneider <vschneid@redhat.com> To: Vincent Guittot <vincent.guittot@linaro.org> To: Peter Zijlstra <peterz@infradead.org> To: Ingo Molnar <mingo@redhat.com> --- kernel/sched/fair.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Comments
On Tue, Jan 30, 2024 at 09:17:05PM +0800, alexs@kernel.org wrote: > From: Alex Shi <alexs@kernel.org> > > And simplify the one line code. No function change. > > Signed-off-by: Alex Shi <alexs@kernel.org> > To: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> > To: Valentin Schneider <vschneid@redhat.com> > To: Vincent Guittot <vincent.guittot@linaro.org> > To: Peter Zijlstra <peterz@infradead.org> > To: Ingo Molnar <mingo@redhat.com> > --- > kernel/sched/fair.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 8d70417f5125..ebd659af2d78 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9741,10 +9741,8 @@ group_type group_classify(unsigned int imbalance_pct, > */ > static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) > { > - if (!sched_smt_active()) > - return true; > - > - return sd->flags & SD_SHARE_CPUCAPACITY || is_core_idle(cpu); > + return (!sched_smt_active()) || > + (sd->flags & SD_SHARE_CPUCAPACITY) || is_core_idle(cpu); I think that compressing the two conditions into one hurts readability. As implemented, it is clear that no further checks are required if there is no SMT. Also, please see my comment in patch 6/6.
On 2/1/24 9:13 AM, Ricardo Neri wrote: > On Tue, Jan 30, 2024 at 09:17:05PM +0800, alexs@kernel.org wrote: >> From: Alex Shi <alexs@kernel.org> >> >> And simplify the one line code. No function change. >> >> Signed-off-by: Alex Shi <alexs@kernel.org> >> To: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> >> To: Valentin Schneider <vschneid@redhat.com> >> To: Vincent Guittot <vincent.guittot@linaro.org> >> To: Peter Zijlstra <peterz@infradead.org> >> To: Ingo Molnar <mingo@redhat.com> >> --- >> kernel/sched/fair.c | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index 8d70417f5125..ebd659af2d78 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -9741,10 +9741,8 @@ group_type group_classify(unsigned int imbalance_pct, >> */ >> static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) >> { >> - if (!sched_smt_active()) >> - return true; >> - >> - return sd->flags & SD_SHARE_CPUCAPACITY || is_core_idle(cpu); >> + return (!sched_smt_active()) || >> + (sd->flags & SD_SHARE_CPUCAPACITY) || is_core_idle(cpu); > > I think that compressing the two conditions into one hurts readability. Sure, will remove this change. Thanks Alex > As implemented, it is clear that no further checks are required if there > is no SMT. > > Also, please see my comment in patch 6/6. >
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8d70417f5125..ebd659af2d78 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9741,10 +9741,8 @@ group_type group_classify(unsigned int imbalance_pct, */ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) { - if (!sched_smt_active()) - return true; - - return sd->flags & SD_SHARE_CPUCAPACITY || is_core_idle(cpu); + return (!sched_smt_active()) || + (sd->flags & SD_SHARE_CPUCAPACITY) || is_core_idle(cpu); } /**