lkml.org 
[lkml]   [2022]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernel/sched: Update schedstats when migrating threads
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

\
 
 \ /
  Last update: 2022-02-22 18:16    [W:0.075 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site