From: Eric Dumazet Date: Wed, 6 Aug 2014 23:06:25 +0000 (-0700) Subject: mm/vmalloc.c: add a schedule point to vmalloc() X-Git-Tag: firefly_0821_release~176^2~3462^2~140 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=660654f90e7f8f6d8163276d47fc1573a39c7007;p=firefly-linux-kernel-4.4.55.git 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. [akpm@linux-foundation.org: 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 --- 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))