Skip to content

some writeback experiments

Wu Fengguang linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest45 patches 67 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/45writeback: reduce calls to global_page_state in balance_dirty_pages()mm/page-writeback.c+33 -6620 replies
2/45writeback: reduce calculation of bdi dirty thresholdsfs/fs-writeback.c include/linux/writeback.h mm/backing-dev.c +1 more+43 -410 replies
3/45ext4: remove unused parameter wbc from __ext4_journalled_writepage()fs/ext4/inode.c+1 -20 replies
4/45writeback: remove unused nonblocking and congestion checksdrivers/staging/pohmelfs/inode.c fs/afs/write.c fs/cifs/file.c +4 more+2 -692 replies
5/45writeback: remove the always false bdi_cap_writeback_dirty() testfs/fs-writeback.c+0 -180 replies
6/45writeback: use larger ratelimit when dirty_exceededmm/page-writeback.c+5 -72 replies
7/45writeback: dont redirty tail an inode with dirty pagesfs/fs-writeback.c+7 -131 reply
8/45writeback: quit on wrap for .range_cyclic (write_cache_pages)mm/page-writeback.c+5 -220 replies
9/45writeback: quit on wrap for .range_cyclic (pohmelfs)drivers/staging/pohmelfs/inode.c+8 -172 replies
10/45writeback: quit on wrap for .range_cyclic (btrfs)fs/btrfs/extent_io.c+6 -150 replies
11/45writeback: quit on wrap for .range_cyclic (cifs)fs/cifs/file.c+4 -140 replies
12/45writeback: quit on wrap for .range_cyclic (ext4)fs/ext4/inode.c+4 -140 replies
13/45writeback: quit on wrap for .range_cyclic (gfs2)fs/gfs2/aops.c+2 -140 replies
14/45writeback: quit on wrap for .range_cyclic (afs)fs/afs/write.c+3 -45 replies
15/45writeback: fix queue_io() orderingfs/fs-writeback.c+5 -20 replies
16/45writeback: merge for_kupdate and !for_kupdate casesfs/fs-writeback.c+6 -330 replies
17/45writeback: only allow two background writeback worksfs/fs-writeback.c include/linux/backing-dev.h+27 -130 replies
18/45writeback: introduce wait queue for balance_dirty_pages()fs/fs-writeback.c include/linux/backing-dev.h mm/backing-dev.c +1 more+103 -4016 replies
19/45writeback: remove the loop in balance_dirty_pages()mm/page-writeback.c+38 -430 replies
20/45NFS: introduce writeback wait queuefs/nfs/client.c fs/nfs/write.c include/linux/nfs_fs_sb.h+73 -116 replies
21/45writeback: estimate bdi write bandwidthfs/fs-writeback.c include/linux/backing-dev.h include/linux/writeback.h +1 more+35 -92 replies
22/45writeback: show bdi write bandwidth in debugfsmm/backing-dev.c+4 -20 replies
23/45writeback: kill space in debugfs item namemm/backing-dev.c+1 -10 replies
24/45writeback: remove global nr_to_write and use timeout insteadfs/fs-writeback.c include/linux/writeback.h mm/backing-dev.c+8 -00 replies
25/45writeback: convert wbc.nr_to_write to per-file parameterfs/fs-writeback.c include/linux/writeback.h mm/backing-dev.c+15 -150 replies
26/45block: pass the non-rotational queue flag to backing_dev_infoblock/blk-core.c block/blk-sysfs.c drivers/block/nbd.c +5 more+28 -90 replies
27/45writeback: introduce wbc.for_backgroundfs/fs-writeback.c fs/nfs/write.c include/linux/writeback.h+3 -10 replies
28/45writeback: introduce wbc.nr_segmentsfs/fs-writeback.c fs/jbd2/commit.c include/linux/writeback.h +2 more+25 -20 replies
29/45writeback: fix the shmem AOP_WRITEPAGE_ACTIVATE casemm/page-writeback.c mm/shmem.c+12 -122 replies
30/45vmscan: lumpy pageoutmm/page-writeback.c mm/vmscan.c+23 -00 replies
31/45writeback: sync old inodes first in background writebackfs/fs-writeback.c+17 -42 replies
32/45writeback: update kupdate expire timestamp on each scan of b_iofs/fs-writeback.c+3 -00 replies
33/45writeback: sync livelock - introduce wbc.for_syncfs/fs-writeback.c include/linux/backing-dev.h include/linux/writeback.h +1 more+22 -230 replies
34/45writeback: sync livelock - kick background writebackfs/fs-writeback.c include/linux/backing-dev.h mm/backing-dev.c+17 -00 replies
35/45writeback: sync livelock - use single timestamp for whole sync workfs/fs-writeback.c+8 -90 replies
36/45writeback: sync livelock - curb dirty speed for inodes to be syncedfs/fs-writeback.c include/linux/backing-dev.h mm/page-writeback.c+18 -00 replies
37/45writeback: use timestamp to indicate dirty exceededinclude/linux/backing-dev.h mm/backing-dev.c mm/page-writeback.c+4 -80 replies
38/45writeback: introduce queue b_more_io_waitfs/fs-writeback.c include/linux/backing-dev.h mm/backing-dev.c+32 -170 replies
39/45writeback: remove wbc.more_iofs/fs-writeback.c include/linux/writeback.h include/trace/events/ext4.h+3 -170 replies
40/45writeback: requeue_io_wait() on I_SYNC locked inodefs/fs-writeback.c+3 -30 replies
41/45writeback: requeue_io_wait() on pages_skipped inodefs/fs-writeback.c+1 -10 replies
42/45writeback: requeue_io_wait() on blocked inodefs/fs-writeback.c+1 -10 replies
43/45writeback: requeue_io_wait() on fs redirtied inodefs/fs-writeback.c+1 -10 replies
44/45NFS: remove NFS_INO_FLUSHING lockfs/nfs/file.c fs/nfs/write.c include/linux/nfs_fs.h+0 -214 replies
45/45btrfs: fix race on syncing the btree inodefs/btrfs/disk-io.c+13 -160 replies

Reviews trailers per patch

2 of 45 patches have a Reviewed-by or Acked-by.

PatchDavid HowellsJan Kara
1/45
2/45
3/45
4/45
5/45
6/45
7/45A-b
8/45
9/45
10/45
11/45
12/45
13/45
14/45A-b
15/45
16/45
17/45
18/45
19/45
20/45
21/45
22/45
23/45
24/45
25/45
26/45
27/45
28/45
29/45
30/45
31/45
32/45
33/45
34/45
35/45
36/45
37/45
38/45
39/45
40/45
41/45
42/45
43/45
44/45
45/45

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/45] some writeback experiments

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