Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758316AbYA2W4R (ORCPT ); Tue, 29 Jan 2008 17:56:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757164AbYA2Wz7 (ORCPT ); Tue, 29 Jan 2008 17:55:59 -0500 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:43608 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757130AbYA2Wz6 (ORCPT ); Tue, 29 Jan 2008 17:55:58 -0500 Date: Tue, 29 Jan 2008 14:55:56 -0800 (PST) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com 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 Subject: Re: [patch 2/6] mmu_notifier: Callbacks to invalidate address ranges In-Reply-To: <20080129223503.GY7233@v2.random> Message-ID: References: <20080128202840.974253868@sgi.com> <20080128202923.849058104@sgi.com> <20080129162004.GL7233@v2.random> <20080129182831.GS7233@v2.random> <20080129213604.GW7233@v2.random> <20080129223503.GY7233@v2.random> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1373 Lines: 27 On Tue, 29 Jan 2008, Andrea Arcangeli wrote: > But now I think there may be an issue with a third thread that may > show unsafe the removal of invalidate_page from ptep_clear_flush. > > A third thread writing to a page through the linux-pte and the guest > VM writing to the same page through the sptes, will be writing on the > same physical page concurrently and using an userspace spinlock w/o > ever entering the kernel. With your patch that invalidate_range after > dropping the PT lock, the third thread may start writing on the new > page, when the guest is still writing to the old page through the > sptes. While this couldn't happen with my patch. A user space spinlock plays into this??? That is irrelevant to the kernel. And we are discussing "your" placement of the invalidate_range not mine. This is the scenario that I described before. You just need two threads. One thread is in do_wp_page and the other is writing through the spte. We are in do_wp_page. Meaning the page is not writable. The writer will have to take fault which will properly serialize access. It a bug if the spte would allow write. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/