writeback, cgroup: Adjust WB_FRN_TIME_CUT_DIV to accelerate foreign inode switching
authorTejun Heo <tj@kernel.org>
Thu, 15 Aug 2019 19:25:28 +0000 (12:25 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 15 Aug 2019 19:30:44 +0000 (13:30 -0600)
commit55a694dffb7fd126b1e047aa46c437731d2700bb
tree4905a829f66886f35d70b29144fa38dbc5e782fe
parentb8e24a9300b0836a9d39f6b20746766b3b81f1bd
writeback, cgroup: Adjust WB_FRN_TIME_CUT_DIV to accelerate foreign inode switching

WB_FRN_TIME_CUT_DIV is used to tell the foreign inode detection logic
to ignore short writeback rounds to prevent getting confused by a
burst of short writebacks.  The parameter is currently 2 meaning that
anything smaller than half of the running average writback duration
will be ignored.

This is unnecessarily aggressive.  The detection logic uses 16 history
slots and is already reasonably protected against some short bursts
confusing it and the current parameter can lead to tens of seconds of
missed detection depending on the writeback pattern.

Let's change the parameter to 8, so that it only ignores writeback
with are smaller than 12.5% of the current running average.

v2: Add comment explaining what's going on with the foreign detection
    parameters.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/fs-writeback.c