public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Chen Yu <yu.c.chen@intel.com>, Swapnil Sapkal <swapnil.sapkal@amd.com>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
	peterz@infradead.org, torvalds@linux-foundation.org,
	juri.lelli@redhat.com, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, mgorman@suse.de, bristot@redhat.com,
	vschneid@redhat.com, vincent.guittot@linaro.org,
	gautham.shenoy@amd.com, kprateek.nayak@amd.com
Subject: Re: [RESEND][PATCH v3 1/1] sched: Report the different kinds of imbalances in /proc/schedstat
Date: Tue, 14 May 2024 19:53:58 +0530	[thread overview]
Message-ID: <e942abce-97ec-4bf1-8220-55bfed18c265@linux.ibm.com> (raw)
In-Reply-To: <ZkNHshuGhY6nBGmJ@chenyu5-mobl2>



On 5/14/24 4:44 PM, Chen Yu wrote:
> On 2024-05-14 at 04:44:45 +0000, Swapnil Sapkal wrote:
>> In /proc/schedstat, lb_imbalance reports the sum of imbalances
>> discovered in sched domains with each call to sched_balance_rq(), which is
>> not very useful because lb_imbalance does not mention whether the imbalance
>> is due to load, utilization, nr_tasks or misfit_tasks. Remove this field
>> from /proc/schedstat.
>>
>> Currently there is no field in /proc/schedstat to report different types
>> of imbalances. Introduce new fields in /proc/schedstat to report the
>> total imbalances in load, utilization, nr_tasks or misfit_tasks.
>>
>> Added fields to /proc/schedstat:
>>  	- lb_imbalance_load: Total imbalance due to load.
>> 	- lb_imbalance_util: Total imbalance due to utilization.
>> 	- lb_imbalance_task: Total imbalance due to number of tasks.
>> 	- lb_imbalance_misfit: Total imbalance due to misfit tasks.
>>
>> Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
>> Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com>
>> ---
>>  Documentation/scheduler/sched-stats.rst | 121 ++++++++++++++----------
>>  include/linux/sched/topology.h          |   5 +-
>>  kernel/sched/fair.c                     |  21 +++-
>>  kernel/sched/stats.c                    |   7 +-
>>  4 files changed, 99 insertions(+), 55 deletions(-)
> 
> [...]
> 
>> diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c
>> index 78e48f5426ee..a02bc9db2f1c 100644
>> --- a/kernel/sched/stats.c
>> +++ b/kernel/sched/stats.c
>> @@ -151,11 +151,14 @@ static int show_schedstat(struct seq_file *seq, void *v)
>>  			seq_printf(seq, "domain%d %*pb", dcount++,
>>  				   cpumask_pr_args(sched_domain_span(sd)));
>>  			for (itype = 0; itype < CPU_MAX_IDLE_TYPES; itype++) {
>> -				seq_printf(seq, " %u %u %u %u %u %u %u %u",
>> +				seq_printf(seq, " %u %u %u %u %u %u %u %u %u %u %u",
>>  				    sd->lb_count[itype],
>>  				    sd->lb_balanced[itype],
>>  				    sd->lb_failed[itype],
>> -				    sd->lb_imbalance[itype],
>> +				    sd->lb_imbalance_load[itype],
>> +				    sd->lb_imbalance_util[itype],
>> +				    sd->lb_imbalance_task[itype],
>> +				    sd->lb_imbalance_misfit[itype],
>>  				    sd->lb_gained[itype],
>>  				    sd->lb_hot_gained[itype],
>>  				    sd->lb_nobusyq[itype],
> 
> Do we need to increase SCHEDSTAT_VERSION to 16?

It's been increased already as part of below commit 

commit 11b0bfa5d463b17cac5bf6b94fea4921713530c3
Author: Ingo Molnar <mingo@kernel.org>
Date:   Fri Mar 8 11:58:55 2024 +0100

    sched/debug: Increase SCHEDSTAT_VERSION to 16
    
    We changed the order of definitions within 'enum cpu_idle_type',
    which changed the order of [CPU_MAX_IDLE_TYPES] columns in
    show_schedstat().


> 
> thanks,
> Chenyu

  reply	other threads:[~2024-05-14 14:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14  4:44 [RESEND][PATCH v3 0/1] Fix lb_imbalance reporting in /proc/schedstat Swapnil Sapkal
2024-05-14  4:44 ` [RESEND][PATCH v3 1/1] sched: Report the different kinds of imbalances " Swapnil Sapkal
2024-05-14 11:14   ` Chen Yu
2024-05-14 14:23     ` Shrikanth Hegde [this message]
2024-05-14 15:14       ` Chen Yu
2024-05-15  5:12         ` 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=e942abce-97ec-4bf1-8220-55bfed18c265@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=bristot@redhat.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=gautham.shenoy@amd.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=swapnil.sapkal@amd.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yu.c.chen@intel.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