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 14:38:37 +0400 Message-ID: <8acda98c0910070338n7220fdabo8c7f8f9e7d21ef6c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 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-f173.google.com ([209.85.221.173]:47128 "EHLO mail-qy0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758380AbZJGKjQ (ORCPT ); Wed, 7 Oct 2009 06:39:16 -0400 Received: by qyk3 with SMTP id 3so4196379qyk.4 for ; Wed, 07 Oct 2009 03:38:39 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, > When pageout a dirty page, try to piggy back more consecutive dirty > pages (up to 512KB) to improve IO efficiency. > > Only ext3/reiserfs which don't have its own aops->writepages are > supported in this initial version. > [...] > /* > + * only write_cache_pages() supports for_reclaim for now > + */ > + if (!mapping->a_ops->writepages) { > + wbc.range_start = (page->index + 1) << PAGE_CACHE_SHIFT; > + wbc.nr_to_write = LUMPY_PAGEOUT_PAGES - 1; > + generic_writepages(mapping, &wbc); > + } This might end up calling ->writepage() on a page_mapped() page, which used to be a problem, at least for shmem (see BUG_ON(page_mapped(page)) in shmem_writepage()). I tried to do a similar thing in the past, but eventually decided do explicitly call ->writepage() in a loop from vmscan.c. This way one can also filter out referenced and active pages. See http://linuxhacker.ru/~nikita/patches/2.6.14-rc5/05-cluster-pageout.patch, it also contains a comment explaining shmem problem. Thank you, Nikita.