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
On Thu, Apr 06, 2017 at 12:47:21PM +0200, Thomas Gleixner wrote:
> On Thu, 6 Apr 2017, Peter Zijlstra wrote:

> > IIRC MIPS has a case where only 1 in N cores has an FPU. And once a task
> > uses FPU, it gets affined to the core that has one or something like
> > that.
> >
> > Of course, nothing then stops someone else breaking that affinity. But I
> > suspect it will simply fault on the next FPU instruction and 'reset' the
> > mask or something. I've no clue and no real desire to know.
>
> It does nasty games with it's own storage of p->thread.user_cpus_allowed
> and a fully seperate implementation of sys_sched_set|getaffinity.
>
> Plus a magic trap handler which forces the thread to a CPU with FPU when
> the user_cpus_allowed mask intersects with the cpus_with_fpu_mask...
>
> Magic crap, which could all be replaced by a simple function in the
> scheduler which allows to push a task to a FPU CPU and then disable
> migration.

If its even halfway coherent, I'd much rather let it stay where it it.

I really want to limit migrate_disable() to PREEMPT_RT=y where its used
to preserve spinlock semantics and not allow random other
migrate_disable() usage in the kernel.

Also note, that per the above, it can actually migrate to any core that
has an FPU on, so its not a good match for migrate_disable() in any
case.

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