From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753145AbdHKOP4 (ORCPT ); Fri, 11 Aug 2017 10:15:56 -0400 Received: from merlin.infradead.org ([205.233.59.134]:50708 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752703AbdHKOPy (ORCPT ); Fri, 11 Aug 2017 10:15:54 -0400 Date: Fri, 11 Aug 2017 16:15:26 +0200 From: Peter Zijlstra To: Vineet Gupta Cc: "torvalds@linux-foundation.org" , "will.deacon@arm.com" , "oleg@redhat.com" , "paulmck@linux.vnet.ibm.com" , "benh@kernel.crashing.org" , "mpe@ellerman.id.au" , "npiggin@gmail.com" , "linux-kernel@vger.kernel.org" , "mingo@kernel.org" , "stern@rowland.harvard.edu" , Russell King , Heiko Carstens , Ralf Baechle , arcml , "David S. Miller" , Mel Gorman , Rik van Riel Subject: Re: ARC stuff (was Re: [PATCH -v2 1/4] mm: Rework {set,clear,mm}_tlb_flush_pending()) Message-ID: <20170811141526.6uvv7iosfchsmjdk@hirez.programming.kicks-ass.net> References: <20170802113837.280183420@infradead.org> <20170802114030.020058451@infradead.org> <20170802131710.qplpoztjjyttbyol@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170802131710.qplpoztjjyttbyol@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 02, 2017 at 03:17:10PM +0200, Peter Zijlstra wrote: > On Wed, Aug 02, 2017 at 06:30:43PM +0530, Vineet Gupta wrote: > > flush_tlb_range() does a bunch of aux register accesses, I need to check > > with hw folks if those can be assumed to serializing w.r.t. memory ordering. > > But if not then we need to add an explicit smb barrier (which will not be > > paired ? ) > > It would pair with the ACQUIRE from the PTL in the below example. > > > and would be penalizing the other callers of flush_tlb_range(). > > Will a new API for this be an overkill ? Is a memory barrier needed here > > anyways - like ARM ! > > It is needed at the very least if you do transparant huge pages as per > the existing logic (this requirement isn't new per this patch, I was > just the silly person wondering if flush_tlb_range() does indeed provide > the ordering assumed). Any word on this? It just got way worse and anything SMP needs to provide this. See commit: 0a2dd266dd6b ("mm: make tlb_flush_pending global") And these semantics are now required for the correct operation of KSM and MADV_{FREE,DONT_NEED}.