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-Url: https://git.stricted.de/?a=commitdiff_plain;h=660654f90e7f8f6d8163276d47fc1573a39c7007;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.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))