[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1262886277.28171.3734.camel@gandalf.stny.rr.com>
Date: Thu, 07 Jan 2010 12:44:37 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: paulmck@...ux.vnet.ibm.com
Cc: Peter Zijlstra <peterz@...radead.org>,
Josh Triplett <josh@...htriplett.org>,
Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
akpm@...ux-foundation.org, tglx@...utronix.de,
Valdis.Kletnieks@...edu, dhowells@...hat.com, laijs@...fujitsu.com,
dipankar@...ibm.com
Subject: Re: [RFC PATCH] introduce sys_membarrier(): process-wide memory
barrier
On Thu, 2010-01-07 at 09:31 -0800, Paul E. McKenney wrote:
> Something like the following for sys_membarrier(), then?
>
> smp_mb();
> for_each_cpu(cpu, current->mm->cpu_vm_mask) {
> if (cpu_curr(cpu)->mm == current->mm)
> smp_call_function_single(cpu, func, NULL, 1);
> }
>
> Then the code changing ->mm on the other CPU also needs to have a
> full smp_mb() somewhere after the change to ->mm, but before starting
> user-space execution. Which it might well just due to overhead, but
> we need to make sure that someone doesn't optimize us out of existence.
To change the mm requires things like flushing the TLB. I'd be surprised
if the change of the mm does not already do a smp_mb() somewhere.
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists