aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2011-11-16 06:34:48 -0500
committerWu Fengguang <fengguang.wu@intel.com>2011-11-16 06:53:44 -0500
commit499d05ecf990a7a7bbf9e0a273f9969f8ec69efc (patch)
treecbcdc35276936db1d63959261bfbc02dda2b48a3 /mm
parent6aaf05f472c97ebceff47d9eef464574f1a55727 (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 <k-mio@sx.jp.nec.com> Tested-by: Kazuya Mio <k-mio@sx.jp.nec.com> Reviewed-by: Neil Brown <neilb@suse.de> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/page-writeback.c5
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:
1133 pages_dirtied, 1133 pages_dirtied,
1134 pause, 1134 pause,
1135 start_time); 1135 start_time);
1136 __set_current_state(TASK_UNINTERRUPTIBLE); 1136 __set_current_state(TASK_KILLABLE);
1137 io_schedule_timeout(pause); 1137 io_schedule_timeout(pause);
1138 1138
1139 dirty_thresh = hard_dirty_limit(dirty_thresh); 1139 dirty_thresh = hard_dirty_limit(dirty_thresh);
@@ -1145,6 +1145,9 @@ pause:
1145 */ 1145 */
1146 if (nr_dirty < dirty_thresh) 1146 if (nr_dirty < dirty_thresh)
1147 break; 1147 break;
1148
1149 if (fatal_signal_pending(current))
1150 break;
1148 } 1151 }
1149 1152
1150 if (!dirty_exceeded && bdi->dirty_exceeded) 1153 if (!dirty_exceeded && bdi->dirty_exceeded)