diff options
author | Eric Dumazet <edumazet@google.com> | 2014-08-06 16:06:25 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 18:01:18 -0700 |
commit | 660654f90e7f8f6d8163276d47fc1573a39c7007 (patch) | |
tree | 9e0f8ffede8d9b77fb6d425bf513aff6d069d3be /mm/vmalloc.c | |
parent | 54980b93c026ac24b7d5046597a254244eafcdeb (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>
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 2 |
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)) |