lkml.org 
[lkml]   [2017]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] kernel: sched: Provide a pointer to the valid CPU mask

* Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> On 2017-04-05 09:39:43 [+0200], Ingo Molnar wrote:
> >
> > So maybe we could add the following facility:
> >
> > ptr = sched_migrate_to_cpu_save(cpu);
> >
> > ...
> >
> > sched_migrate_to_cpu_restore(ptr);

BTW., and I'm sure this has come up before, but why doesn't migrate_disable() use
a simple per task flag that the scheduler migration code takes into account?

It should be functionally equivalent to the current solution, and it appears to
have a heck of a smaller cross section with the rest of the scheduler.

I.e.:

static inline void migrate_disable(void)
{
current->migration_disabled++;
}

...

static inline void migrate_enable(void)
{
current->migration_disabled--;
}

or so? Then add this flag as a condition to can_migrate_task() et al.

While we generally dislike such flags as they wreck havoc with the scheduler if
overused, the cpus_allowed based solution has the exact same effect so it's not
like it's a step backwards - and it should also be much faster and less intrusive.

Am I missing some complication?

Thanks,

Ingo

\
 
 \ /
  Last update: 2017-04-06 08:18    [W:0.072 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site