From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hugh Dickins Subject: Re: [PATCH 30/45] vmscan: lumpy pageout Date: Thu, 8 Oct 2009 09:20:03 +0100 (BST) Message-ID: References: <8acda98c0910070338n7220fdabo8c7f8f9e7d21ef6c@mail.gmail.com> <20091007111454.GB15936@localhost> <8acda98c0910070437g1498f99eua9a5ad71e6c2bae4@mail.gmail.com> <20091007132924.GB20855@localhost> <20091007134254.GA26244@localhost> <20091007142054.GA6798@localhost> <8acda98c0910070750x6428b96fgdeee5946d1408888@mail.gmail.com> <20091007150047.GA9848@localhost> <8acda98c0910070850x14614e0fh832f5cd29b1588f0@mail.gmail.com> <20091008023701.GA20021@localhost> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Nikita Danilov , Andrew Morton , Theodore Tso , Christoph Hellwig , Dave Chinner , Chris Mason , Peter Zijlstra , "Li, Shaohua" , Myklebust Trond , "jens.axboe@oracle.com" , Jan Kara , Nick Piggin , "linux-fsdevel@vger.kernel.org" To: Wu Fengguang Return-path: Received: from mk-filter-2-a-1.mail.uk.tiscali.com ([212.74.100.53]:16460 "EHLO mk-filter-2-a-1.mail.uk.tiscali.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755702AbZJHIUv (ORCPT ); Thu, 8 Oct 2009 04:20:51 -0400 In-Reply-To: <20091008023701.GA20021@localhost> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, 8 Oct 2009, Wu Fengguang wrote: > On Wed, Oct 07, 2009 at 11:50:58PM +0800, Nikita Danilov wrote: > > > > One potential problem with this is that generic_writepages() waits on > > page locks and this can stall kswapd (always bad). This can be worked > > around by replacing lock_page() with trylock_page() conditionally on > > wbc->for_reclaim (or wbc->nonblocking?), but then, this almost look > > like a separate function would be better. > > IMHO trylock_page() is not necessary. Locked pages are rare in normal > states. kswapd already do lock_page() for all pages it try to examine > state for reclaim. So it makes sense for lumpy pageout to follow the > (simple) convention. You're mistaken? The only lock_page() I see in vmscan.c is in handle_write_error(), the important ones are all trylock_page(). And I agree with Nikita that they need to be trylock_page(). Hugh