Re: [RFC PATCH] introduce sys_membarrier(): process-wide memory barrier

Paul E. McKenney
2010-01-07T19:17:08Z

On Thu, Jan 07, 2010 at 01:59:42PM -0500, Steven Rostedt wrote:
> On Thu, 2010-01-07 at 10:39 -0800, Paul E. McKenney wrote:
>
> > > sys_membarrier() should "insert" mb() on behalf of B "instead"
> > > of barrier(), right? But, if we send IPI, B enters kernel mode
> > > and returns to user-mode. Should this imply mb() in any case?
> >
> > Hello, Oleg,
> >
> > The issue is with some suggested optimizations that would avoid sending
> > the IPI to CPUs that are not running threads in the same process as the
> > thread executing the sys_membarrier(). Some forms of these optimizations
> > sample ->mm without locking, and the question is whether this is safe.
>
> Note, we are not suggesting optimizations. It has nothing to do with
> performance of the syscall. We just can't allow one process to be DoSing
> another process on another cpu by it sending out millions of IPIs.
> Mathieu already showed that you could cause a 2x slowdown to the
> unrelated tasks.

I would have said that we are trying to optimize our way out of a DoS
situation, but point taken. Whatever we choose to call it, the discussion
is on the suggested modifications, not strictly on the original patch. ;-)

Thanx, Paul