Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbdHHLES (ORCPT ); Tue, 8 Aug 2017 07:04:18 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33306 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921AbdHHLER (ORCPT ); Tue, 8 Aug 2017 07:04:17 -0400 Date: Tue, 8 Aug 2017 13:04:06 +0200 From: Peter Zijlstra To: Anshuman Khandual Cc: Laurent Dufour , paulmck@linux.vnet.ibm.com, akpm@linux-foundation.org, kirill@shutemov.name, ak@linux.intel.com, mhocko@kernel.org, dave@stgolabs.net, jack@suse.cz, Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, npiggin@gmail.com, bsingharora@gmail.com, Tim Chen Subject: Re: [RFC v5 04/11] mm: VMA sequence count Message-ID: <20170808110406.sathbzn4yxlq66ss@hirez.programming.kicks-ass.net> References: <1497635555-25679-1-git-send-email-ldufour@linux.vnet.ibm.com> <1497635555-25679-5-git-send-email-ldufour@linux.vnet.ibm.com> <1536011f-c8ac-0c00-7018-90cf3384f048@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1536011f-c8ac-0c00-7018-90cf3384f048@linux.vnet.ibm.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: 1350 Lines: 38 On Tue, Aug 08, 2017 at 04:29:32PM +0530, Anshuman Khandual wrote: > On 06/16/2017 11:22 PM, Laurent Dufour wrote: > > From: Peter Zijlstra > > > > First of all, please do mention that its adding a new element into the > vm_area_struct which will act as a sequential lock element and help > in navigating page fault without mmap_sem lock. You're not making sense, there is no lock, and the lines below clearly state we're adding a sequence count. > > > Wrap the VMA modifications (vma_adjust/unmap_page_range) with sequence > > counts such that we can easily test if a VMA is changed > > Yeah true. > > > > > The unmap_page_range() one allows us to make assumptions about > > page-tables; when we find the seqcount hasn't changed we can assume > > page-tables are still valid. > > Because unmap_page_range() is the only function which can tear it down ? > Or is there any other reason for this assumption ? Yep. > > > > The flip side is that we cannot distinguish between a vma_adjust() and > > the unmap_page_range() -- where with the former we could have > > re-checked the vma bounds against the address. > > Distinguished for what purpose ? It states. If you know its a vma_adjust we could just check if we're inside the new boundaries and continue. But since we cannot, we have to assume the worst and bail.