path: root/mm
diff options
authorEric Dumazet <>2014-08-06 16:06:25 -0700
committerLinus Torvalds <>2014-08-06 18:01:18 -0700
commit660654f90e7f8f6d8163276d47fc1573a39c7007 (patch)
tree9e0f8ffede8d9b77fb6d425bf513aff6d069d3be /mm
parent54980b93c026ac24b7d5046597a254244eafcdeb (diff)
mm/vmalloc.c: add a schedule point to vmalloc()
It is not uncommon on busy servers to get stuck hundred of ms in vmalloc() calls (like file descriptor expansions). Add a cond_resched() to __vmalloc_area_node() to be gentle to other tasks. [ only do it for __GFP_WAIT, per David] Signed-off-by: Eric Dumazet <> Cc: Hugh Dickins <> Acked-by: David Rientjes <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm')
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index fdbb116ee669..a3cad905f560 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1602,6 +1602,8 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
goto fail;
area->pages[i] = page;
+ if (gfp_mask & __GFP_WAIT)
+ cond_resched();
if (map_vm_area(area, prot, &pages))