lkml.org 
[lkml]   [2017]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2] membarrier: expedited private command
On Tue, Aug 01, 2017 at 01:32:43PM +0300, Avi Kivity wrote:
> I hate to propose a way to make this more complicated, but this could be
> fixed by a process first declaring its intent to use expedited process-wide
> membarrier; if it does, then every context switch updates a process-wide
> cpumask indicating which cpus are currently running threads of that process:
>
> if (prev->mm != next->mm)
> if (prev->mm->running_cpumask)
> cpumask_clear(...);
> else if (next->mm->running_cpumask)
> cpumask_set(...);
>
> now only processes that want expedited process-wide membarrier pay for it
> (in other than some predictable branches). You can even have threads opt-in,
> so unrelated threads that don't participate in the party don't cause those
> bits to be set.

Either that or conditionally put in a smp_mb in switch_mm() for that
process. But yes, once we advertise intent (either explicit or implicit
on first use), there's various things that can be done.


\
 
 \ /
  Last update: 2017-08-01 12:46    [W:0.101 / U:12.572 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site