[PATCH] netpoll can lock up on low memory.

Steven Rostedt
2005-08-05T14:38:10Z

Looking at the netpoll routines, I noticed that the find_skb could
lockup if the memory is low. This is because the allocations are called
with GFP_ATOMIC (since this is in interrupt context) and if it fails, it
will continue to fail. This is just by observing the code, I didn't have
this actually happen. So if this is not the case, please let me know how
it can get out. Otherwise, please accept this patch. Also, as Andi told
me, the printk here would probably not show up anyway if this happens
with netconsole.

Here I changed it to break out instead of just looping.

-- Steve

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

--- linux-2.6.13-rc3/net/core/netpoll.c.orig 2005-08-05 09:37:00.000000000 -0400
+++ linux-2.6.13-rc3/net/core/netpoll.c 2005-08-05 10:29:32.000000000 -0400
@@ -229,8 +229,9 @@ repeat:
}

if(!skb) {
- count++;
- if (once && (count == 1000000)) {
+ if (count++ == 100000)
+ return NULL;
+ if (once)
printk("out of netpoll skbs!\n");
once = 0;
}