Skip to content

writeback: kernel visibility

Michael Rubin linux-fsdevel linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5mm: exporting account_page_dirtyfs/ceph/addr.c mm/page-writeback.c+2 -70 replies
2/5mm: account_page_writeback addedfs/nilfs2/segment.c include/linux/mm.h mm/page-writeback.c+14 -21 reply
3/5writeback: nr_dirtied and nr_written in /proc/vmstatinclude/linux/mmzone.h mm/page-writeback.c mm/vmstat.c+7 -01 reply
4/5writeback: Adding /sys/devices/system/node/<node>/vmstatdrivers/base/node.c+14 -02 replies
5/5writeback: Reporting dirty thresholds in /proc/vmstatinclude/linux/mmzone.h mm/vmstat.c+6 -02 replies

Reviews trailers per patch

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

PatchWu FengguangKOSAKI Motohiro
1/5R-b
2/5R-b R-b
3/5R-b
4/5R-b
5/5

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 0/5] writeback: kernel visibility

Patch #1 sets up some helper functions for account_page_dirty and fixes a bug in ceph

Patch #2 sets up some helper functions for account_page_writeback

Patch #3 adds writeback visibility in /proc/vmstat

To help developers and applications gain visibility into writeback behaviour this patch adds two counters to /proc/vmstat.

  # grep nr_dirtied /proc/vmstat
  nr_dirtied 3747
  # grep nr_written /proc/vmstat
  nr_written 3618

These entries allow user apps to understand writeback behaviour over time and learn how it is impacting their performance. Currently there is no way to inspect dirty and writeback speed over time. It's not possible for nr_dirty/nr_writeback.

These entries are necessary to give visibility into writeback behaviour. We have /proc/diskstats which lets us understand the io in the block layer. We have blktrace for more in depth understanding. We have e2fsprogs and debugsfs to give insight into the file systems behaviour, but we don't offer our users the ability understand what writeback is doing. There is no way to know how active it is over the whole system, if it's falling behind or to quantify it's efforts. With these values exported users can easily see how much data applications are sending through writeback and also at what rates writeback is processing this data. Comparing the rates of change between the two allow developers to see when writeback is not able to keep up with incoming traffic and the rate of dirty memory being sent to the IO back end. This allows folks to understand their io workloads and track kernel issues. Non kernel engineers at Google often use these counters to solve puzzling performance problems.

Patch #4 adds a pernode vmstat file with nr_dirtied and nr_written

Patch #5 add writeback thresholds to /proc/vmstat

Currently these values are in debugfs. But they should be promoted to /proc since they are useful for developers who are writing databases and file servers and are not debugging the kernel.

The output is as below:

 # grep threshold /proc/vmstat
 nr_pages_dirty_threshold 409111
 nr_pages_dirty_background_threshold 818223

Michael Rubin (5):
mm: exporting account_page_dirty
mm: account_page_writeback added
writeback: nr_dirtied and nr_written in /proc/vmstat
writeback: Adding /sys/devices/system/node/<node>/vmstat
writeback: Reporting dirty thresholds in /proc/vmstat

 drivers/base/node.c    |   14 ++++++++++++++
 fs/ceph/addr.c         |    8 +-------
 fs/nilfs2/segment.c    |    2 +-
 include/linux/mm.h     |    1 +
 include/linux/mmzone.h |    4 ++++
 mm/page-writeback.c    |   16 +++++++++++++++-
 mm/vmstat.c            |    7 +++++++
 7 files changed, 43 insertions(+), 9 deletions(-)

--
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>