From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751924AbdHCP1h (ORCPT ); Thu, 3 Aug 2017 11:27:37 -0400 Received: from foss.arm.com ([217.140.101.70]:42108 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751154AbdHCP1g (ORCPT ); Thu, 3 Aug 2017 11:27:36 -0400 Date: Thu, 3 Aug 2017 16:27:36 +0100 From: Will Deacon To: Peter Zijlstra Cc: torvalds@linux-foundation.org, 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 , Vineet Gupta , "David S. Miller" , Mel Gorman , Rik van Riel Subject: Re: [PATCH -v2 1/4] mm: Rework {set,clear,mm}_tlb_flush_pending() Message-ID: <20170803152735.GC20783@arm.com> References: <20170802113837.280183420@infradead.org> <20170802114030.020058451@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170802114030.020058451@infradead.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 02, 2017 at 01:38:38PM +0200, Peter Zijlstra wrote: > Commit: > > af2c1401e6f9 ("mm: numa: guarantee that tlb_flush_pending updates are visible before page table updates") > > added smp_mb__before_spinlock() to set_tlb_flush_pending(). I think we > can solve the same problem without this barrier. > > If instead we mandate that mm_tlb_flush_pending() is used while > holding the PTL we're guaranteed to observe prior > set_tlb_flush_pending() instances. > > For this to work we need to rework migrate_misplaced_transhuge_page() > a little and move the test up into do_huge_pmd_numa_page(). > > NOTE: this relies on flush_tlb_range() to guarantee: > > (1) it ensures that prior page table updates are visible to the > page table walker and > (2) it ensures that subsequent memory accesses are only made > visible after the invalidation has completed Works for me: Acked-by: Will Deacon Will