From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932558Ab0KRRlh (ORCPT ); Thu, 18 Nov 2010 12:41:37 -0500 Received: from smtp-out.google.com ([74.125.121.35]:11182 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758349Ab0KRRlf (ORCPT ); Thu, 18 Nov 2010 12:41:35 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=XD89Ltm3RdOfyF1tiilRlMqcvYwUWpX4T5uo3wQ/84+LhpTNnDqg3hUoYIfc/EeB4M k16/jy00eUEddcY86jbw== Date: Thu, 18 Nov 2010 09:41:22 -0800 (PST) From: Hugh Dickins X-X-Sender: hughd@tigran.mtv.corp.google.com To: Christoph Hellwig cc: Dave Chinner , Michel Lespinasse , Peter Zijlstra , Nick Piggin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Rik van Riel , Kosaki Motohiro , Theodore Tso , Michael Rubin , Suleiman Souhlal Subject: Re: [PATCH 3/3] mlock: avoid dirtying pages and triggering writeback In-Reply-To: <20101118133702.GA18834@infradead.org> Message-ID: References: <1289996638-21439-1-git-send-email-walken@google.com> <1289996638-21439-4-git-send-email-walken@google.com> <20101117125756.GA5576@amd> <1290007734.2109.941.camel@laptop> <20101117231143.GQ22876@dastard> <20101118133702.GA18834@infradead.org> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 Nov 2010, Christoph Hellwig wrote: > On Thu, Nov 18, 2010 at 10:11:43AM +1100, Dave Chinner wrote: > > Hence I think that avoiding ->page_mkwrite callouts is likely to > > break some filesystems in subtle, undetected ways. IMO, regardless > > of what is done, it would be really good to start by writing a new > > regression test to exercise and encode the expected the mlock > > behaviour so we can detect regressions later on.... > > I think it would help if we could drink a bit of the test driven design > coolaid here. Michel, can you write some testcases where pages on a > shared mapping are mlocked, then dirtied and then munlocked, and then > written out using msync/fsync. Anything that fails this test on > btrfs/ext4/gfs/xfs/etc obviously doesn't work. Whilst it's hard to argue against a request for testing, Dave's worries just sprang from a misunderstanding of all the talk about "avoiding -> page_mkwrite". There's nothing strange or risky about Michel's patch, it does not avoid ->page_mkwrite when there is a write: it just stops pretending that there was a write when locking down the shared area. Hugh From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with ESMTP id 53BB46B0089 for ; Thu, 18 Nov 2010 12:41:40 -0500 (EST) Received: from kpbe11.cbf.corp.google.com (kpbe11.cbf.corp.google.com [172.25.105.75]) by smtp-out.google.com with ESMTP id oAIHfXQ4028706 for ; Thu, 18 Nov 2010 09:41:35 -0800 Received: from qyk4 (qyk4.prod.google.com [10.241.83.132]) by kpbe11.cbf.corp.google.com with ESMTP id oAIHfUF8015336 for ; Thu, 18 Nov 2010 09:41:32 -0800 Received: by qyk4 with SMTP id 4so402069qyk.17 for ; Thu, 18 Nov 2010 09:41:32 -0800 (PST) Date: Thu, 18 Nov 2010 09:41:22 -0800 (PST) From: Hugh Dickins Subject: Re: [PATCH 3/3] mlock: avoid dirtying pages and triggering writeback In-Reply-To: <20101118133702.GA18834@infradead.org> Message-ID: References: <1289996638-21439-1-git-send-email-walken@google.com> <1289996638-21439-4-git-send-email-walken@google.com> <20101117125756.GA5576@amd> <1290007734.2109.941.camel@laptop> <20101117231143.GQ22876@dastard> <20101118133702.GA18834@infradead.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: Christoph Hellwig Cc: Dave Chinner , Michel Lespinasse , Peter Zijlstra , Nick Piggin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Rik van Riel , Kosaki Motohiro , Theodore Tso , Michael Rubin , Suleiman Souhlal List-ID: On Thu, 18 Nov 2010, Christoph Hellwig wrote: > On Thu, Nov 18, 2010 at 10:11:43AM +1100, Dave Chinner wrote: > > Hence I think that avoiding ->page_mkwrite callouts is likely to > > break some filesystems in subtle, undetected ways. IMO, regardless > > of what is done, it would be really good to start by writing a new > > regression test to exercise and encode the expected the mlock > > behaviour so we can detect regressions later on.... > > I think it would help if we could drink a bit of the test driven design > coolaid here. Michel, can you write some testcases where pages on a > shared mapping are mlocked, then dirtied and then munlocked, and then > written out using msync/fsync. Anything that fails this test on > btrfs/ext4/gfs/xfs/etc obviously doesn't work. Whilst it's hard to argue against a request for testing, Dave's worries just sprang from a misunderstanding of all the talk about "avoiding -> page_mkwrite". There's nothing strange or risky about Michel's patch, it does not avoid ->page_mkwrite when there is a write: it just stops pretending that there was a write when locking down the shared area. Hugh -- 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/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: email@kvack.org