linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 30/45] vmscan: lumpy pageout
@ 2009-10-07 10:38 Nikita Danilov
  2009-10-07 11:14 ` Wu Fengguang
  0 siblings, 1 reply; 14+ messages in thread
From: Nikita Danilov @ 2009-10-07 10:38 UTC (permalink / raw)
  To: Wu Fengguang
  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

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.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH 00/45] some writeback experiments
@ 2009-10-07  7:38 Wu Fengguang
  2009-10-07  7:38 ` [PATCH 30/45] vmscan: lumpy pageout Wu Fengguang
  0 siblings, 1 reply; 14+ messages in thread
From: Wu Fengguang @ 2009-10-07  7:38 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Theodore Tso, Christoph Hellwig, Dave Chinner, Chris Mason,
	Peter Zijlstra, Li Shaohua, Myklebust Trond,
	jens.axboe@oracle.com, Jan Kara, Nick Piggin, linux-fsdevel,
	Wu Fengguang, LKML

Hi all,

Here is a collection of writeback patches on

- larger writeback chunk sizes
- single per-bdi flush thread (killing the foreground throttling writeouts)
- lumpy pageout
- sync livelock prevention
- writeback scheduling
- random fixes

Sorry for posting a too big series - there are many direct or implicit
dependencies, and one patch lead to another before I can stop..

The lumpy pageout and nr_segments support is not complete and do not
cover all filesystems for now. It may be better to first convert some of
the ->writepages to the generic routines to avoid duplicate work.

I managed to address many issues in past week, however there are still known
problems. Hints from filesystem developers are highly appreciated. Thanks!

The estimated writeback bandwidth is about 1/2 the real throughput
for ext2/3/4 and btrfs; noticeable bigger than real throughput for NFS; and
cannot be estimated at all for XFS.  Very interesting..

NFS writeback is very bumpy. The page numbers and network throughput "freeze"
together from time to time:

# vmmon -d 1 nr_writeback nr_dirty nr_unstable      # (per 1-second samples)
     nr_writeback         nr_dirty      nr_unstable
            11227            41463            38044
            11227            41463            38044
            11227            41463            38044
            11227            41463            38044
            11045            53987             6490
            11033            53120             8145
            11195            52143            10886
            11211            52144            10913
            11211            52144            10913
            11211            52144            10913

btrfs seems to maintain a private pool of writeback pages, which can go out of
control:

     nr_writeback         nr_dirty
           261075              132
           252891              195
           244795              187
           236851              187
           228830              187
           221040              218
           212674              237
           204981              237

XFS has very interesting "bumpy writeback" behavior: it tends to wait
collect enough pages and then write the whole world.

     nr_writeback         nr_dirty
            80781                0
            37117            37703
            37117            43933
            81044                6
            81050                0
            43943            10199
            43930            36355
            43930            36355
            80293                0
            80285                0
            80285                0

Thanks,
Fengguang

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-10-08 10:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07 10:38 [PATCH 30/45] vmscan: lumpy pageout Nikita Danilov
2009-10-07 11:14 ` Wu Fengguang
2009-10-07 11:32   ` Nick Piggin
2009-10-07 11:37   ` Nikita Danilov
2009-10-07 13:29     ` Wu Fengguang
2009-10-07 13:42       ` Wu Fengguang
2009-10-07 14:20         ` Wu Fengguang
2009-10-07 14:50           ` Nikita Danilov
2009-10-07 15:00             ` Wu Fengguang
2009-10-07 15:50               ` Nikita Danilov
2009-10-08  2:37                 ` Wu Fengguang
2009-10-08  8:20                   ` Hugh Dickins
2009-10-08 10:12                     ` Wu Fengguang
  -- strict thread matches above, loose matches on Subject: below --
2009-10-07  7:38 [PATCH 00/45] some writeback experiments Wu Fengguang
2009-10-07  7:38 ` [PATCH 30/45] vmscan: lumpy pageout Wu Fengguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).