Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755734AbXLRXye (ORCPT ); Tue, 18 Dec 2007 18:54:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754229AbXLRXy0 (ORCPT ); Tue, 18 Dec 2007 18:54:26 -0500 Received: from mx1.suse.de ([195.135.220.2]:51130 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753017AbXLRXyZ (ORCPT ); Tue, 18 Dec 2007 18:54:25 -0500 Date: Wed, 19 Dec 2007 00:54:23 +0100 From: Nick Piggin To: Fengguang Wu Cc: Andrew Morton , Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/9] readahead: clean up and simplify the code for filemap page fault readahead Message-ID: <20071218235423.GB20838@wotan.suse.de> References: <20071216115927.986126305@mail.ustc.edu.cn> <20071216120417.748714367@mail.ustc.edu.cn> <20071218081907.GB32114@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1009 Lines: 25 On Tue, Dec 18, 2007 at 07:50:33PM +0800, Fengguang Wu wrote: > On Tue, Dec 18, 2007 at 09:19:07AM +0100, Nick Piggin wrote: > > On Sun, Dec 16, 2007 at 07:59:30PM +0800, Fengguang Wu wrote: > > > > + read_lock_irq(&mapping->tree_lock); > > > + page = radix_tree_lookup(&mapping->page_tree, offset); > > > + if (likely(page)) { > > > + int got_lock, uptodate; > > > + page_cache_get(page); > > > + > > > + got_lock = !TestSetPageLocked(page); > > > + uptodate = PageUptodate(page); > > > + read_unlock_irq(&mapping->tree_lock); > > > > If we could avoid open coding tree_lock here (and expanding its coverage > > to PageUptodate), that would be nice. I don't think it gains us too much. > > To use find_get_page()? That would be nice to me, too. Exactly. -- 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/