Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759659AbYFRGrn (ORCPT ); Wed, 18 Jun 2008 02:47:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756663AbYFRGrf (ORCPT ); Wed, 18 Jun 2008 02:47:35 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:54334 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756585AbYFRGre (ORCPT ); Wed, 18 Jun 2008 02:47:34 -0400 Date: Wed, 18 Jun 2008 15:52:33 +0900 From: KAMEZAWA Hiroyuki To: Nick Piggin Cc: Daisuke Nishimura , Andrew Morton , Rik van Riel , Lee Schermerhorn , Kosaki Motohiro , Nick Piggin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-testers@vger.kernel.org, "hugh@veritas.com" Subject: Re: [PATCH] migration_entry_wait fix. Message-Id: <20080618155233.7dd79312.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <200806181642.38379.nickpiggin@yahoo.com.au> References: <20080611225945.4da7bb7f.akpm@linux-foundation.org> <200806181535.58036.nickpiggin@yahoo.com.au> <20080618150436.dca5eb75.kamezawa.hiroyu@jp.fujitsu.com> <200806181642.38379.nickpiggin@yahoo.com.au> Organization: Fujitsu X-Mailer: Sylpheed 2.4.2 (GTK+ 2.10.11; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1627 Lines: 43 On Wed, 18 Jun 2008 16:42:37 +1000 Nick Piggin wrote: > > (This fix is not related to lock_page() problem.) > > > > If I read your advice correctly, we shouldn't use lock_page() here. > > > > Before speculative page cache, page_table_entry of a page under migration > > has a pte entry which encodes pfn as special pte entry. and wait for the > > end of page migration by lock_page(). > > What I don't think I understand, is how we can have a page in the > page tables (and with the ptl held) but with a zero refcount... Oh, > it's not actually a page but a migration entry! I'm not quite so > familiar with that code. > > Hmm, so we might possibly see a page there that has a zero refcount > due to page_freeze_refs? In which case, I think the direction of you > fix is good. Sorry for my misunderstanding the problem, and thank > you for fixing up my code! > > I would ask you to use get_page_unless_zero rather than > page_cache_get_speculative(), because it's not exactly a speculative > reference -- a speculative reference is one where we elevate _count > and then must recheck that the page we have is correct. > ok. > Also, please add a comment. It would really be nicer to hide this > transiently-frozen state away from migration_entry_wait, but I can't > see any lock that would easily solve it. > ok, will adds comments. Thanks, -Kame -- 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/