All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Carlos Bilbao <carlos.bilbao@amd.com>
Cc: peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, mingo@redhat.com,
	dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/sched: Update schedstats when migrating threads
Date: Tue, 22 Feb 2022 12:15:46 -0500	[thread overview]
Message-ID: <20220222121546.4a45e049@gandalf.local.home> (raw)
In-Reply-To: <6b4d8615-4c60-3d89-5210-b495344cabd4@amd.com>

On Tue, 22 Feb 2022 10:32:32 -0600
Carlos Bilbao <carlos.bilbao@amd.com> wrote:

> > @@ -8765,7 +8766,14 @@ 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 */
> > +	if (schedstat_enabled()) {
> > +		forced_migrations = schedstat_val(p->stats.nr_forced_migrations);
> > +		migrations_cold = schedstat_val(p->stats.nr_migrations_cold);
> > +		memset(&p->stats, 0, sizeof(p->stats));
> > +		schedstat_set(p->stats.nr_forced_migrations, forced_migrations);
> > +		schedstat_set(p->stats.nr_migrations_cold, migrations_cold);
> > +		schedstat_inc(p->stats.nr_migrations_cold);
> > +	}
> >  
> >  	trace_sched_move_numa(p, curr_cpu, target_cpu);
> >  	return stop_one_cpu(curr_cpu, migration_cpu_stop, &arg);  
> 
> 
> I would love to hear some thoughts on this. 

I have no issues with this.

Peter?

-- Steve

  reply	other threads:[~2022-02-22 17:15 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 [this message]
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
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=20220222121546.4a45e049@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.