From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Danilov Subject: Re: [PATCH 30/45] vmscan: lumpy pageout Date: Wed, 7 Oct 2009 19:50:58 +0400 Message-ID: <8acda98c0910070850x14614e0fh832f5cd29b1588f0@mail.gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: 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 mail-qy0-f202.google.com ([209.85.221.202]:33817 "EHLO mail-qy0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759374AbZJGPvf convert rfc822-to-8bit (ORCPT ); Wed, 7 Oct 2009 11:51:35 -0400 Received: by qyk40 with SMTP id 40so4384812qyk.22 for ; Wed, 07 Oct 2009 08:50:59 -0700 (PDT) In-Reply-To: <20091007150047.GA9848@localhost> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 2009/10/7 Wu Fengguang : [...] > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (current_is_kswapd() && > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bdi_cap_writeback_dirty(mapping= ->backing_dev_info) && > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 !mapping->a_ops->writepages) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 wbc.range_start =3D (pa= ge->index + 1) << PAGE_CACHE_SHIFT; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 wbc.nr_to_write =3D LUM= PY_PAGEOUT_PAGES - 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 generic_writepages(mapp= ing, &wbc); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 iput(inode); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* 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. On a good side, it seems I was wrong and pageout calls iput() already: shrink_slab()->prune_icache()->iput(). Thank you, Nikita. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html