Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751726AbdIUNKD (ORCPT ); Thu, 21 Sep 2017 09:10:03 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:38379 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751436AbdIUNKB (ORCPT ); Thu, 21 Sep 2017 09:10:01 -0400 Date: Thu, 21 Sep 2017 15:09:50 +0200 From: Peter Zijlstra To: Mathieu Desnoyers Cc: Andy Lutomirski , "Paul E. McKenney" , Will Deacon , Alan Stern , Michael Ellerman , linux-kernel , linux-arch , Dave Watson , maged michael Subject: Re: Rough notes from sys_membarrier() lightning BoF Message-ID: <20170921130950.nwfbyiil34psoyua@hirez.programming.kicks-ass.net> References: <20170917223608.GA14577@linux.vnet.ibm.com> <1264439870.15044.1505931230400.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1264439870.15044.1505931230400.JavaMail.zimbra@efficios.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 919 Lines: 20 On Wed, Sep 20, 2017 at 06:13:50PM +0000, Mathieu Desnoyers wrote: > > Also, can you elaborate on the PPC issue? PPC appears to track > > mm_cpumask more or less just like x86. Is the issue just that this > > tracking has no implied barriers? If so, how does TLB flush on ppc > > work? It really does seem impressive to me that an architecture can > > efficiently support munmap() but not an expedited private membarrier. > > I'll leave this question to the PPC experts :) IIRC PPC does not keep a tight mm_cpumask, it only sets bit, it never clears bits. The atomic op required to set bits does not imply any memory barrier on PPC. TLB invalidation is a TLBI instruction, it sends TLBI broadcast packets over the interconnect, it doesn't require IPIs like x86. The only optimization PPC does is that if the mm_cpumask has only a single bit set, it uses a TLBI instruction without broadcast, which is cheaper.