[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1e4f3521-7253-44e1-bd63-616a18ea89df@amd.com>
Date: Thu, 19 Dec 2024 11:38:06 +0530
From: "Sapkal, Swapnil" <swapnil.sapkal@....com>
To: Peter Zijlstra <peterz@...radead.org>
CC: <mingo@...hat.com>, <juri.lelli@...hat.com>, <vincent.guittot@...aro.org>,
<corbet@....net>, <dietmar.eggemann@....com>, <rostedt@...dmis.org>,
<bsegall@...gle.com>, <mgorman@...e.de>, <vschneid@...hat.com>,
<iamjoonsoo.kim@....com>, <qyousef@...alina.io>, <sshegde@...ux.ibm.com>,
<alexs@...nel.org>, <lukasz.luba@....com>, <gautham.shenoy@....com>,
<kprateek.nayak@....com>, <ravi.bangoria@....com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/6] sched: Report the different kinds of imbalances in
/proc/schedstat
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
Powered by blists - more mailing lists