From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 29 Jan 2008 16:22:46 -0800 (PST) From: Christoph Lameter Subject: Re: [patch 2/6] mmu_notifier: Callbacks to invalidate address ranges In-Reply-To: <20080130000559.GB7233@v2.random> Message-ID: References: <20080128202840.974253868@sgi.com> <20080128202923.849058104@sgi.com> <20080129162004.GL7233@v2.random> <20080129211759.GV7233@v2.random> <20080129220212.GX7233@v2.random> <20080130000039.GA7233@v2.random> <20080130000559.GB7233@v2.random> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Andrea Arcangeli Cc: Robin Holt , Avi Kivity , Izik Eidus , Nick Piggin , kvm-devel@lists.sourceforge.net, Benjamin Herrenschmidt , Peter Zijlstra , steiner@sgi.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, daniel.blueman@quadrics.com, Hugh Dickins List-ID: On Wed, 30 Jan 2008, Andrea Arcangeli wrote: > On Wed, Jan 30, 2008 at 01:00:39AM +0100, Andrea Arcangeli wrote: > > get_user_pages, regular linux writes don't fault unless it's > > explicitly writeprotect, which is mandatory in a few archs, x86 not). > > actually get_user_pages doesn't fault either but it calls into > set_page_dirty, however get_user_pages (unlike a userland-write) at > least requires mmap_sem in read mode and the PT lock as serialization, > userland writes don't, they just go ahead and mark the pte in hardware > w/o faults. Anyway anonymous memory these days always mapped with > dirty bit set regardless, even for read-faults, after Nick finally > rightfully cleaned up the zero-page trick. That is only partially true. pte are created wronly in order to track dirty state these days. The first write will lead to a fault that switches the pte to writable. When the page undergoes writeback the page again becomes write protected. Thus our need to effectively deal with page_mkclean. -- 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