aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/net_dropmonitor.py
diff options
context:
space:
mode:
authorDerek Basehore <[email protected]>2014-04-03 14:46:22 -0700
committerLinus Torvalds <[email protected]>2014-04-03 16:20:49 -0700
commit6ca738d60c563d5c6cf6253ee4b8e76fa77b2b9e (patch)
tree916ff20799200fa096d6e6d757d2755fb53b6f17 /tools/perf/scripts/python/net_dropmonitor.py
parenta0c32761e73c9999cbf592b702f284221fea8040 (diff)
backing_dev: fix hung task on sync
bdi_wakeup_thread_delayed() used the mod_delayed_work() function to schedule work to writeback dirty inodes. The problem with this is that it can delay work that is scheduled for immediate execution, such as the work from sync_inodes_sb(). This can happen since mod_delayed_work() can now steal work from a work_queue. This fixes the problem by using queue_delayed_work() instead. This is a regression caused by commit 839a8e8660b6 ("writeback: replace custom worker pool implementation with unbound workqueue"). The reason that this causes a problem is that laptop-mode will change the delay, dirty_writeback_centisecs, to 60000 (10 minutes) by default. In the case that bdi_wakeup_thread_delayed() races with sync_inodes_sb(), sync will be stopped for 10 minutes and trigger a hung task. Even if dirty_writeback_centisecs is not long enough to cause a hung task, we still don't want to delay sync for that long. We fix the problem by using queue_delayed_work() when we want to schedule writeback sometime in future. This function doesn't change the timer if it is already armed. For the same reason, we also change bdi_writeback_workfn() to immediately queue the work again in the case that the work_list is not empty. The same problem can happen if the sync work is run on the rescue worker. [[email protected]: update changelog, add comment, use bdi_wakeup_thread_delayed()] Signed-off-by: Derek Basehore <[email protected]> Reviewed-by: Jan Kara <[email protected]> Cc: Alexander Viro <[email protected]> Reviewed-by: Tejun Heo <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: "Darrick J. Wong" <[email protected]> Cc: Derek Basehore <[email protected]> Cc: Kees Cook <[email protected]> Cc: Benson Leung <[email protected]> Cc: Sonny Rao <[email protected]> Cc: Luigi Semenzato <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Dave Chinner <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions