aboutsummaryrefslogtreecommitdiff
path: root/mm/vmalloc.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-08-06 16:06:25 -0700
committerMoyster <oysterized@gmail.com>2019-05-02 21:10:32 +0200
commitdb0ba484ab756d543111acfb91419bee47793b79 (patch)
treef9257372a78dc05c1974660e8dbb0e8fc3cc9251 /mm/vmalloc.c
parent0e116b700531318237a69ad2d0374b22d155c229 (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. [akpm@linux-foundation.org: only do it for __GFP_WAIT, per David] Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Hugh Dickins <hughd@google.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Change-Id: Ia77a022dc0ab628038ad6cff9fc555f369e44064 (cherry picked from commit 6d99b20b413075cc1c8babb68fa3f33cf5f7cb2e)
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r--mm/vmalloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 3a5af8024..2b8159f56 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1637,6 +1637,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))