public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Sapkal, Swapnil" <swapnil.sapkal@amd.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: <mingo@redhat.com>, <juri.lelli@redhat.com>,
	<vincent.guittot@linaro.org>, <corbet@lwn.net>,
	<dietmar.eggemann@arm.com>, <rostedt@goodmis.org>,
	<bsegall@google.com>, <mgorman@suse.de>, <vschneid@redhat.com>,
	<iamjoonsoo.kim@lge.com>, <qyousef@layalina.io>,
	<sshegde@linux.ibm.com>, <alexs@kernel.org>,
	<lukasz.luba@arm.com>, <gautham.shenoy@amd.com>,
	<kprateek.nayak@amd.com>, <ravi.bangoria@amd.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/6] sched: Report the different kinds of imbalances in /proc/schedstat
Date: Thu, 19 Dec 2024 11:38:06 +0530	[thread overview]
Message-ID: <1e4f3521-7253-44e1-bd63-616a18ea89df@amd.com> (raw)
In-Reply-To: <20241218114003.GL11133@noisy.programming.kicks-ass.net>

Hello Peter,

Thanks for the review.

On 12/18/2024 5:10 PM, Peter Zijlstra wrote:
> On Wed, Dec 18, 2024 at 04:36:26AM +0000, Swapnil Sapkal wrote:
> 
>> +static void update_lb_imbalance_stat(struct lb_env *env, struct sched_domain *sd,
>> +				     enum cpu_idle_type idle)
>> +{
>> +	switch (env->migration_type) {
>> +	case migrate_load:
>> +		schedstat_add(sd->lb_imbalance_load[idle], env->imbalance);
>> +		break;
>> +	case migrate_util:
>> +		schedstat_add(sd->lb_imbalance_util[idle], env->imbalance);
>> +		break;
>> +	case migrate_task:
>> +		schedstat_add(sd->lb_imbalance_task[idle], env->imbalance);
>> +		break;
>> +	case migrate_misfit:
>> +		schedstat_add(sd->lb_imbalance_misfit[idle], env->imbalance);
>> +		break;
>> +	}
>> +}
> 
> 
> Can you please write that like:
> 
> 	if (!schedstat_enabled())
> 		return;
> 
> 	switch () {
> 	case ...
> 		__schedstat_add();
> 	}
> 
> It makes no sense to have 4 copies of schedstat_enabled() inside the
> switch statement -- esp. since afaik the compilers aren't able to CSE
> static keys :/

This makes sense. I will update this change in v2.

--
Thanks and Regards,
Swapnil

  reply	other threads:[~2024-12-19  6:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18  4:36 [PATCH 0/6] Fixes and improvements in /proc/schedstat Swapnil Sapkal
2024-12-18  4:36 ` [PATCH 1/6] sched/fair: Fix value reported by hot tasks pulled " Swapnil Sapkal
2024-12-18  4:36 ` [PATCH 2/6] sched/fair: Cleanup in migrate_degrades_locality() to improve readability Swapnil Sapkal
2024-12-18  4:36 ` [PATCH 3/6] sched: Report the different kinds of imbalances in /proc/schedstat Swapnil Sapkal
2024-12-18 11:40   ` Peter Zijlstra
2024-12-19  6:08     ` Sapkal, Swapnil [this message]
2024-12-18  4:36 ` [PATCH 4/6] sched: Move sched domain name out of CONFIG_SCHED_DEBUG Swapnil Sapkal
2024-12-18  4:36 ` [PATCH 5/6] sched/stats: Print domain name in /proc/schedstat Swapnil Sapkal
2024-12-18  4:36 ` [PATCH 6/6] docs: Update Schedstat version to 17 Swapnil Sapkal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e4f3521-7253-44e1-bd63-616a18ea89df@amd.com \
    --to=swapnil.sapkal@amd.com \
    --cc=alexs@kernel.org \
    --cc=bsegall@google.com \
    --cc=corbet@lwn.net \
    --cc=dietmar.eggemann@arm.com \
    --cc=gautham.shenoy@amd.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qyousef@layalina.io \
    --cc=ravi.bangoria@amd.com \
    --cc=rostedt@goodmis.org \
    --cc=sshegde@linux.ibm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox