From: Phil Auld <pauld@redhat.com>
To: Carlos Bilbao <carlos.bilbao@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
juri.lelli@redhat.com, vincent.guittot@linaro.org,
mingo@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] kernel/sched: Update schedstats when migrating threads
Date: Thu, 24 Feb 2022 09:03:13 -0500 [thread overview]
Message-ID: <YheQIU7oFDcaPoD7@lorien.usersys.redhat.com> (raw)
In-Reply-To: <3c6224ca-c0da-7ba9-1396-a2e74c4a40e8@amd.com>
On Wed, Feb 23, 2022 at 10:13:50AM -0600 Carlos Bilbao wrote:
> The kernel manages per-task scheduler statistics or schedstats. Update
> function migrate_task_to() to increase the counter for migrations.
>
> Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
> ---
> Changelog:
> v2: Update commit message, don't reinitialize sched fields.
> ---
> kernel/sched/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index fcf0c180617c..1360e501c737 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -8751,7 +8751,7 @@ int migrate_task_to(struct task_struct *p, int target_cpu)
> if (!cpumask_test_cpu(target_cpu, p->cpus_ptr))
> return -EINVAL;
>
> - /* TODO: This is not properly updating schedstats */
> + schedstat_inc(p->stats.nr_migrations_cold);
>
I was going to give a reviewed by since I was looking at this,
but I can't convince myself that nr_migrations_cold is right.
This looks more like a "hot" migration (using stop_cpu to force
it). But nr_migrations_cold is not incremented anywhere else so
maybe it's a terminology thing.
Can you tell me why this is the right counter?
Thanks,
Phil
> trace_sched_move_numa(p, curr_cpu, target_cpu);
> return stop_one_cpu(curr_cpu, migration_cpu_stop, &arg);
> --
> 2.27.0
>
--
next prev parent reply other threads:[~2022-02-24 14:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 15:22 [PATCH] kernel/sched: Update schedstats when migrating threads Carlos Bilbao
2022-02-22 16:32 ` Carlos Bilbao
2022-02-22 17:15 ` Steven Rostedt
2022-02-23 10:19 ` Peter Zijlstra
2022-02-23 15:14 ` Carlos Bilbao
2022-02-23 15:28 ` Phil Auld
2022-02-23 15:33 ` Carlos Bilbao
2022-02-23 15:47 ` Phil Auld
2022-02-23 15:59 ` Carlos Bilbao
2022-02-23 16:13 ` [PATCH v2] " Carlos Bilbao
2022-02-24 14:03 ` Phil Auld [this message]
2022-02-24 15:05 ` Carlos Bilbao
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=YheQIU7oFDcaPoD7@lorien.usersys.redhat.com \
--to=pauld@redhat.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=carlos.bilbao@amd.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).