[PATCH 13 of 13] congestion wait

Andrea Arcangeli
2008-01-08T07:50:44Z

# User andrea@cpushare.com
# Date 1199701210 -3600
# Node ID 352591adebd643c51fe629c5ee343342f60b24f0
# Parent 74af3b1477511c7bd6a526b47195ddf95a5424dc
congestion wait

Don't block in congestion_wait if memdie is set.

Signed-off-by: Andrea Arcangeli <andrea@suse.de>

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -83,6 +83,9 @@ long congestion_wait(int rw, long timeou
DEFINE_WAIT(wait);
wait_queue_head_t *wqh = &congestion_wqh[rw];

+ if (unlikely(test_thread_flag(TIF_MEMDIE)))
+ return timeout;
+
prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
ret = io_schedule_timeout(timeout);
finish_wait(wqh, &wait);