diff options
author | Jan Kara <[email protected]> | 2011-11-16 19:34:48 +0800 |
---|---|---|
committer | Wu Fengguang <[email protected]> | 2011-11-16 19:53:44 +0800 |
commit | 499d05ecf990a7a7bbf9e0a273f9969f8ec69efc (patch) | |
tree | cbcdc35276936db1d63959261bfbc02dda2b48a3 | |
parent | 6aaf05f472c97ebceff47d9eef464574f1a55727 (diff) |
mm: Make task in balance_dirty_pages() killable
There is no reason why task in balance_dirty_pages() shouldn't be killable
and it helps in recovering from some error conditions (like when filesystem
goes in error state and cannot accept writeback anymore but we still want to
kill processes using it to be able to unmount it).
There will be follow up patches to further abort the generic_perform_write()
and other filesystem write loops, to avoid large write + SIGKILL combination
exceeding the dirty limit and possibly strange OOM.
Reported-by: Kazuya Mio <[email protected]>
Tested-by: Kazuya Mio <[email protected]>
Reviewed-by: Neil Brown <[email protected]>
Reviewed-by: KOSAKI Motohiro <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Wu Fengguang <[email protected]>
-rw-r--r-- | mm/page-writeback.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index a3278f005230..79c34419fadd 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1133,7 +1133,7 @@ pause: pages_dirtied, pause, start_time); - __set_current_state(TASK_UNINTERRUPTIBLE); + __set_current_state(TASK_KILLABLE); io_schedule_timeout(pause); dirty_thresh = hard_dirty_limit(dirty_thresh); @@ -1145,6 +1145,9 @@ pause: */ if (nr_dirty < dirty_thresh) break; + + if (fatal_signal_pending(current)) + break; } if (!dirty_exceeded && bdi->dirty_exceeded) |