Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759948AbXJEJFo (ORCPT ); Fri, 5 Oct 2007 05:05:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753581AbXJEJFg (ORCPT ); Fri, 5 Oct 2007 05:05:36 -0400 Received: from gw.goop.org ([64.81.55.164]:53389 "EHLO mail.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753493AbXJEJFf (ORCPT ); Fri, 5 Oct 2007 05:05:35 -0400 Message-ID: <4705FE5C.4060807@goop.org> Date: Fri, 05 Oct 2007 02:05:32 -0700 From: Jeremy Fitzhardinge User-Agent: Thunderbird 2.0.0.5 (X11/20070727) MIME-Version: 1.0 To: Keir Fraser CC: Andrew Morton , Hugh Dickens , David Rientjes , Zachary Amsden , Linus Torvalds , Rusty Russell , Andi Kleen , Linux Kernel Mailing List Subject: Re: race with page_referenced_one->ptep_test_and_clear_young and pagetable setup/pulldown References: In-Reply-To: X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1420 Lines: 42 Keir Fraser wrote: > > Hang on! How is the access unlocked? By my reading > page_referenced_one()->page_check_address()->spin_lock(pte_lockptr()). > Ah, OK. I'd overlooked that. > The problem here is most likely insufficient locking in the pin/unpin > table-walking code, in light of the fact that you are probably running > with > per-page spinlocks (SPLIT_PTLOCK_CPUS). Because we nobble that option > in our > own kernel ports it suffices to take the page_table_lock when doing the > walk-[un]pin-remap routine. This is *not* true with SPLIT_PTLOCK_CPUS. > Hm, I see. > Fortuitously, Jan Beulich has a patch to fix this. It's not going to be > directly applicable to 2.6.23-rc series, but should be easily ported: > . > OK, I can use that. Andi says: > Do I misread that patch or does it really walk the complete address > space and try to take all possible locks? Isn't that very slow? > That's pretty much what it has to do. Pinning/unpinning walks the whole pagetable anyway, so it shouldn't be much more expensive. And they're relatively rare operations (fork, exec, exit). J - 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/