The patch titled Subject: writeback: avoid division by 0 in wb_update_dirty_ratelimit() has been removed from the -mm tree. Its filename was writeback-fix-bandwidth-estimate-for-spiky-workload-fix.patch This patch was dropped because it was folded into writeback-fix-bandwidth-estimate-for-spiky-workload.patch ------------------------------------------------------ From: Jan Kara <jack@xxxxxxx> Subject: writeback: avoid division by 0 in wb_update_dirty_ratelimit() Fixup patch "writeback: Fix bandwidth estimate for spiky workload" which introduced possibility of __wb_update_bandwidth() getting called at a moment when 'elapsed' evaluates to 0. Cc: Jan Kara <jack@xxxxxxx> Cc: Michael Stapelberg <stapelberg+linux@xxxxxxxxxx> Cc: Wu Fengguang <fengguang.wu@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page-writeback.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/mm/page-writeback.c~writeback-fix-bandwidth-estimate-for-spiky-workload-fix +++ a/mm/page-writeback.c @@ -1336,11 +1336,19 @@ static void __wb_update_bandwidth(struct { struct bdi_writeback *wb = gdtc->wb; unsigned long now = jiffies; - unsigned long elapsed = now - wb->bw_time_stamp; + unsigned long elapsed; unsigned long dirtied; unsigned long written; spin_lock(&wb->list_lock); + + /* + * Lockless checks for elapsed time are racy and delayed update after + * IO completion doesn't do it at all (to make sure written pages are + * accounted reasonably quickly). Make sure elapsed >= 1 to avoid + * division errors. + */ + elapsed = max(now - wb->bw_time_stamp, 1UL); dirtied = percpu_counter_read(&wb->stat[WB_DIRTIED]); written = percpu_counter_read(&wb->stat[WB_WRITTEN]); _ Patches currently in -mm which might be from jack@xxxxxxx are writeback-track-number-of-inodes-under-writeback.patch writeback-reliably-update-bandwidth-estimation.patch writeback-fix-bandwidth-estimate-for-spiky-workload.patch writeback-rename-domain_update_bandwidth.patch writeback-use-read_once-for-unlocked-reads-of-writeback-stats.patch