mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm/vmalloc.c: add a schedule point to vmalloc()
@ 2014-06-24 14:00 Eric Dumazet
  2014-06-24 22:18 ` David Rientjes
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2014-06-24 14:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Hugh Dickins, David Rientjes

From: Eric Dumazet <edumazet@google.com>

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.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>
---
 mm/vmalloc.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index f64632b67196..05a145ed1332 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1602,6 +1602,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 			goto fail;
 		}
 		area->pages[i] = page;
+		cond_resched();
 	}
 
 	if (map_vm_area(area, prot, &pages))



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-24 22:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-24 14:00 [PATCH] mm/vmalloc.c: add a schedule point to vmalloc() Eric Dumazet
2014-06-24 22:18 ` David Rientjes
2014-06-24 22:25   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®