From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934069AbbCPRNs (ORCPT ); Mon, 16 Mar 2015 13:13:48 -0400 Received: from casper.infradead.org ([85.118.1.10]:43997 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932398AbbCPRNr (ORCPT ); Mon, 16 Mar 2015 13:13:47 -0400 Date: Mon, 16 Mar 2015 18:13:34 +0100 From: Peter Zijlstra To: Mathieu Desnoyers Cc: linux-kernel@vger.kernel.org, KOSAKI Motohiro , Steven Rostedt , "Paul E. McKenney" , Nicholas Miell , Linus Torvalds , Ingo Molnar , Alan Cox , Lai Jiangshan , Stephen Hemminger , Andrew Morton , Josh Triplett , Thomas Gleixner , David Howells , Nick Piggin Subject: Re: [RFC PATCH] sys_membarrier(): system/process-wide memory barrier (x86) (v12) Message-ID: <20150316171334.GG21418@twins.programming.kicks-ass.net> References: <1426447459-28620-1-git-send-email-mathieu.desnoyers@efficios.com> <20150316141939.GE21418@twins.programming.kicks-ass.net> <1203077851.9491.1426520636551.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1203077851.9491.1426520636551.JavaMail.zimbra@efficios.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 16, 2015 at 03:43:56PM +0000, Mathieu Desnoyers wrote: > > > +++ b/arch/x86/include/asm/mmu_context.h > > In both cases the cpumask_set_cpu() will also imply a MB. > > I'm probably missing what exactly in cpumask_set_cpu() > implies this guarantee. cpumask_set_cpu() uses set_bit(). > On x86, set_bit is indeed implemented with a lock-prefixed > orb or bts. However, the comment above set_bit() states: But its very much x86 specific code you're patching, so the LOCK prefix is sufficient ;-)