From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750705AbWDDPUR (ORCPT ); Tue, 4 Apr 2006 11:20:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750708AbWDDPUQ (ORCPT ); Tue, 4 Apr 2006 11:20:16 -0400 Received: from omx1-ext.sgi.com ([192.48.179.11]:24279 "EHLO omx1.americas.sgi.com") by vger.kernel.org with ESMTP id S1750705AbWDDPUP (ORCPT ); Tue, 4 Apr 2006 11:20:15 -0400 Date: Tue, 4 Apr 2006 08:20:03 -0700 (PDT) From: Christoph Lameter To: Nick Piggin cc: Andrew Morton , Linux Kernel , Linux Memory Management Subject: Re: [patch 2/3] mm: speculative get_page In-Reply-To: <20060219020159.9923.94877.sendpatchset@linux.site> Message-ID: References: <20060219020140.9923.43378.sendpatchset@linux.site> <20060219020159.9923.94877.sendpatchset@linux.site> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Looks like the NoNewRefs flag is mostly == spin_is_locked(mapping->tree_lock)? Would it not be better to check the tree_lock? > --- linux-2.6.orig/mm/migrate.c > +++ linux-2.6/mm/migrate.c > > + SetPageNoNewRefs(page); > write_lock_irq(&mapping->tree_lock); A dream come true! If this is really working as it sounds then we can move the SetPageNoNewRefs up and avoid the final check under mapping->tree_lock. Then keep SetPageNoNewRefs until the page has been copied. It would basically play the same role as locking the page.