From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: Re: [PATCH 30/45] vmscan: lumpy pageout Date: Thu, 8 Oct 2009 18:12:25 +0800 Message-ID: <20091008101225.GA9433@localhost> References: <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: Hugh Dickins Return-path: Received: from mga14.intel.com ([143.182.124.37]:56136 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755393AbZJHKNq (ORCPT ); Thu, 8 Oct 2009 06:13:46 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Oct 08, 2009 at 04:20:03PM +0800, Hugh Dickins wrote: > 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(). Ah big sorry! I should really double check the code.. OK I'll do trylock_page(). Thanks, Fengguang