[PATCH] netpoll can lock up on low memory.

From: Steven Rostedt
Date: Fri Aug 05 2005 - 09:43:10 EST


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@xxxxxxxxxxx>

--- 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;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/