From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 22 Jun 2006 14:17:24 +0100 (BST) From: Hugh Dickins Subject: Re: [PATCH 1/6] mm: tracking shared dirty pages In-Reply-To: <1150976031.15744.122.camel@lappy> Message-ID: References: <20060619175243.24655.76005.sendpatchset@lappy> <20060619175253.24655.96323.sendpatchset@lappy> <20060621225639.4c8bad93.akpm@osdl.org> <1150976031.15744.122.camel@lappy> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Peter Zijlstra Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, christoph@lameter.com, mbligh@google.com, npiggin@suse.de, torvalds@osdl.org List-ID: On Thu, 22 Jun 2006, Peter Zijlstra wrote: > On Wed, 2006-06-21 at 22:56 -0700, Andrew Morton wrote: > > > > + vma->vm_page_prot = > > > + __pgprot(pte_val > > > + (pte_wrprotect > > > + (__pte(pgprot_val(vma->vm_page_prot))))); > > > + > > > > Is there really no simpler way? >.... > Awell, thoughts, comments? Just note vma->vm_page_prot before calling the ->mmap and check after. If the driver has messed with it at all, it's not a mapping we want to apply dirty capping to anyway. If it's unchanged, and the other tests pass, go ahead and reset readonly vm_page_prot via protection_map[]. This is of course a hack, as is the pgprotting code from drm. The correct solution would be to set the proper backing_dev_info in a number of drivers - we were too lazy when setting the default in the first place; but even if we caught all the intree drivers, we'd miss out-of-tree ones and suffer unnecessary pain from them. So for now a hack is necessary, and I haven't thought of a better. Other comments to follow... 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/ . Don't email: email@kvack.org