lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100107184016.GM6764@linux.vnet.ibm.com>
Date:	Thu, 7 Jan 2010 10:40:16 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Steven Rostedt <rostedt@...dmis.org>
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, Jan 07, 2010 at 01:04:07PM -0500, Steven Rostedt wrote:
> On Thu, 2010-01-07 at 09:56 -0800, Paul E. McKenney wrote:
> > On Thu, Jan 07, 2010 at 12:44:37PM -0500, Steven Rostedt wrote:
> > > 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.
> > 
> > Agreed, but "somewhere" does not fill me with warm fuzzies.  ;-)
> 
> Another question would be, does flushing the TLB imply a mb()?

I do not believe that it is guaranteed to on all architectures.

							Thanx, Paul
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ