From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by kanga.kvack.org (Postfix) with ESMTP id 89FD96B0035 for ; Fri, 25 Apr 2014 18:00:32 -0400 (EDT) Received: by mail-pa0-f43.google.com with SMTP id rd3so1770816pab.2 for ; Fri, 25 Apr 2014 15:00:32 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com. [134.134.136.24]) by mx.google.com with ESMTP id ov9si5672724pbc.170.2014.04.25.15.00.31 for ; Fri, 25 Apr 2014 15:00:31 -0700 (PDT) Message-ID: <535ADAFD.9040308@intel.com> Date: Fri, 25 Apr 2014 15:00:29 -0700 From: Dave Hansen MIME-Version: 1.0 Subject: Re: Dirty/Access bits vs. page content References: <53558507.9050703@zytor.com> <20140422075459.GD11182@twins.programming.kicks-ass.net> <20140423184145.GH17824@quack.suse.cz> <20140424065133.GX26782@laptop.programming.kicks-ass.net> <1398389846.8437.6.camel@pasglop> <1398393700.8437.22.camel@pasglop> <5359CD7C.5020604@zytor.com> <535A9356.8060608@intel.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Hugh Dickins Cc: Linus Torvalds , "H. Peter Anvin" , Benjamin Herrenschmidt , Peter Zijlstra , Jan Kara , "linux-arch@vger.kernel.org" , linux-mm , Russell King - ARM Linux , Tony Luck On 04/25/2014 11:41 AM, Hugh Dickins wrote: > On Fri, 25 Apr 2014, Dave Hansen wrote: >> On 04/25/2014 05:01 AM, Hugh Dickins wrote: >>> Er, i_mmap_mutex. >>> >>> That's what unmap_mapping_range(), and page_mkclean()'s rmap_walk, >>> take to iterate over the file vmas. So perhaps there's no race at all >>> in the unmap_mapping_range() case. And easy (I imagine) to fix the >>> race in Dave's racewrite.c use of MADV_DONTNEED: untested patch below. >>> >>> But exit and munmap() don't take i_mmap_mutex: perhaps they should >>> when encountering a VM_SHARED vma (I believe VM_SHARED should be >>> peculiar to having vm_file set, but test both below because I don't >>> want to oops in some odd corner where a special vma is set up). >> >> Hey Hugh, >> >> Do you want some testing on this? > > Yes, please do: I just haven't gotten around to cloning the git > tree and trying it. It's quite likely that we shall go Linus's > way rather than this, but still useful to have the information > as to whether this way really is viable. Your patch works fine for the madvise() case. The effect appears the same as Linus's to my test case at least. I didn't test any unmaps or other creative uses of unmap_mapping_range(). -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org