[PATCH 12 of 13] gfp-repeat stop with TIF_MEMDIE

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

# User andrea@cpushare.com
# Date 1199692960 -3600
# Node ID 74af3b1477511c7bd6a526b47195ddf95a5424dc
# Parent ecc696d359edebbfe35566510f78a4be445c8f67
gfp-repeat stop with TIF_MEMDIE

Let the GFP_REPEAT task quit if TIF_MEMDIE is set.

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

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1617,7 +1617,8 @@ nofail_alloc:
if (!(gfp_mask & __GFP_NORETRY)) {
if ((order <= PAGE_ALLOC_COSTLY_ORDER) ||
(gfp_mask & __GFP_REPEAT))
- do_retry = 1;
+ if (likely(!test_thread_flag(TIF_MEMDIE)))
+ do_retry = 1;
if (gfp_mask & __GFP_NOFAIL)
do_retry = 1;