Skip to content

RFC writeback: try to write older pages first

Wu Fengguang linux-fsdevel linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 39 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6writeback: pass writeback_control down to move_expired_inodes()fs/fs-writeback.c+8 -83 replies
2/6writeback: the kupdate expire timestamp should be a moving targetfs/fs-writeback.c include/linux/writeback.h include/trace/events/writeback.h +2 more+10 -244 replies
3/6writeback: kill writeback_control.more_iofs/fs-writeback.c include/linux/writeback.h include/trace/events/writeback.h+3 -127 replies
4/6writeback: sync expired inodes first in background writebackfs/fs-writeback.c+14 -615 replies
5/6writeback: try more writeback as long as something was writtenfs/fs-writeback.c+11 -84 replies
6/6writeback: introduce writeback_control.inodes_writtenfs/fs-writeback.c include/linux/writeback.h+6 -01 reply

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchJan KaraMel GormanMinchan Kim
1/6A-b A-b R-b
2/6A-b A-b
3/6A-b A-b
4/6A-b
5/6
6/6A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/6] [RFC] writeback: try to write older pages first

Andrew,

The basic way of avoiding pageout() is to make the flusher sync inodes in the right order. Oldest dirty inodes contains oldest pages. The smaller inode it is, the more correlation between inode dirty time and its pages' dirty time. So for small dirty inodes, syncing in the order of inode dirty time is able to avoid pageout(). If pageout() is still triggered frequently in this case, the 30s dirty expire time may be too long and could be shrinked adaptively; or it may be a stressed memcg list whose dirty inodes/pages are more hard to track.

For a large dirty inode, it may flush lots of newly dirtied pages _after_ syncing the expired pages. This is the normal case for a single-stream sequential dirtier, where older pages are in lower offsets. In this case we shall not insist on syncing the whole large dirty inode before considering the other small dirty inodes. This risks wasting time syncing 1GB freshly dirtied pages before syncing the other N*1MB expired dirty pages who are approaching the end of the LRU list and hence pageout().

For a large dirty inode, it may also flush lots of newly dirtied pages _before_ hitting the desired old ones, in which case it helps for pageout() to do some clustered writeback, and/or set mapping->writeback_index to help the flusher focus on old pages.

For a large dirty inode, it may also have intermixed old and new dirty pages. In this case we need to make sure the inode is queued for IO before some of its pages hit pageout(). Adaptive dirty expire time helps here.

OK, end of the vapour ideas. As for this patchset, it fixes the current kupdate/background writeback priority:

- the kupdate/background writeback shall include newly expired inodes at each queue_io() time, as the large inodes left over from previous writeback rounds are likely to have less density of old pages.

- the background writeback shall consider expired inodes first, just like the kupdate writeback

Thanks,
Fengguang

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>