Messages in this thread | | | Subject | Re: [RFC patch] introduce sys_membarrier(): process-wide memory barrier (v9) | From | Steven Rostedt <> | Date | Fri, 26 Feb 2010 00:37:01 -0500 |
| |
On Fri, 2010-02-26 at 16:08 +1100, Nick Piggin wrote: > On Thu, Feb 25, 2010 at 11:53:01AM -0500, Mathieu Desnoyers wrote:
> > This is actually what I did in v1 of the patch, but this implementation met > > resistance from the RT people, who were concerned about the impact on RT tasks > > of a lower priority process doing lots of sys_membarrier() calls. So if we want > > to do other-process-aware sys_membarrier(), we would have to iterate on all > > cpus, for every running process shared memory maps and see if there is something > > shared with all shm of the current process. This is clearly not as trivial as > > just broadcasting the IPI to all cpus. > > I don't see how this is fundamentally worse than your existing approach, > because on some architectures with asids, the mm_cpumask isn't cleared > when a process is scheduled off the CPU then you could effectively just > cause IPIs to lots of CPUs anyway.
That's why checking the mm_cpumask isn't the only check. That just limits what CPUs we check, but before a IPI is sent, that cpu has its rq lock held and a check against cpu_curr(cpu)->mm vs the current->mm. If that fails, then that CPU does not have an IPI sent to it.
-- Steve
| |