From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [RFC PATCH 2/2] mm: mmu_notifier fix for tlb_end_vma Date: Thu, 23 Aug 2018 14:41:05 +0100 Message-ID: <20180823134104.GD1496@brain-police> References: <20180823084709.19717-1-npiggin@gmail.com> <20180823084709.19717-3-npiggin@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20180823084709.19717-3-npiggin@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: Nicholas Piggin Cc: Peter Zijlstra , torvalds@linux-foundation.org, luto@kernel.org, x86@kernel.org, bp@alien8.de, riel@surriel.com, jannh@google.com, ascannell@google.com, dave.hansen@intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, David Miller , Martin Schwidefsky , Michael Ellerman , linux-arch@vger.kernel.org List-Id: linux-arch.vger.kernel.org On Thu, Aug 23, 2018 at 06:47:09PM +1000, Nicholas Piggin wrote: > The generic tlb_end_vma does not call invalidate_range mmu notifier, > and it resets resets the mmu_gather range, which means the notifier > won't be called on part of the range in case of an unmap that spans > multiple vmas. > > ARM64 seems to be the only arch I could see that has notifiers and > uses the generic tlb_end_vma. I have not actually tested it. > > Signed-off-by: Nicholas Piggin > --- > include/asm-generic/tlb.h | 17 +++++++++++++---- > mm/memory.c | 10 ---------- > 2 files changed, 13 insertions(+), 14 deletions(-) I think we only use the notifiers in the KVM code, which appears to leave the ->invalidate_range() callback empty, so that at least explains why we haven't run into problems here. But the change looks correct to me, so: Acked-by: Will Deacon Thanks, Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com ([217.140.101.70]:46652 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730895AbeHWRKy (ORCPT ); Thu, 23 Aug 2018 13:10:54 -0400 Date: Thu, 23 Aug 2018 14:41:05 +0100 From: Will Deacon Subject: Re: [RFC PATCH 2/2] mm: mmu_notifier fix for tlb_end_vma Message-ID: <20180823134104.GD1496@brain-police> References: <20180823084709.19717-1-npiggin@gmail.com> <20180823084709.19717-3-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180823084709.19717-3-npiggin@gmail.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Nicholas Piggin Cc: Peter Zijlstra , torvalds@linux-foundation.org, luto@kernel.org, x86@kernel.org, bp@alien8.de, riel@surriel.com, jannh@google.com, ascannell@google.com, dave.hansen@intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, David Miller , Martin Schwidefsky , Michael Ellerman , linux-arch@vger.kernel.org Message-ID: <20180823134105.dW1hUy4qhA1OWD_DRmdCW_L06W_58Ouosu5e8sh80Tc@z> On Thu, Aug 23, 2018 at 06:47:09PM +1000, Nicholas Piggin wrote: > The generic tlb_end_vma does not call invalidate_range mmu notifier, > and it resets resets the mmu_gather range, which means the notifier > won't be called on part of the range in case of an unmap that spans > multiple vmas. > > ARM64 seems to be the only arch I could see that has notifiers and > uses the generic tlb_end_vma. I have not actually tested it. > > Signed-off-by: Nicholas Piggin > --- > include/asm-generic/tlb.h | 17 +++++++++++++---- > mm/memory.c | 10 ---------- > 2 files changed, 13 insertions(+), 14 deletions(-) I think we only use the notifiers in the KVM code, which appears to leave the ->invalidate_range() callback empty, so that at least explains why we haven't run into problems here. But the change looks correct to me, so: Acked-by: Will Deacon Thanks, Will