Thread (16 messages) flat view 16 messages, 4 authors, 2006-07-12

Re: [Patch 6/6] per task delay accounting taskstats interface: fix clone skbs for each listener

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2006-07-11 11:15:49
Also in: netdev

On Tue, Jul 11, 2006 at 03:57:31AM -0700, Andrew Morton wrote:
quoted
quoted
quoted
      down_write(&listeners->sem);
      list_for_each_entry_safe(s, tmp, &listeners->list, list) {
-             ret = genlmsg_unicast(skb, s->pid);
+             skb_next = NULL;
+             if (!list_islast(&s->list, &listeners->list)) {
+                     skb_next = skb_clone(skb_cur, GFP_KERNEL);
If we do a GFP_KERNEL allocation with this semaphore held, and the
oom-killer tries to kill something to satisfy the allocation, and the
killed task gets stuck on that semaphore, I wonder of the box locks up.
We do GFP_KERNEL inside semaphores/mutexes in lots of places.  So if this
can deadlock with the oom-killer we probably should fix that, preferably
by having GFP_KERNEL fail in that case.
This lock is special, in that it's taken on the exit() path (I think).  So
it can block tasks which are trying to exit.
Sorry, missed the context.

If there is a deadlock then it's not just this allocation that you
need worry about.  There is also an allocation within genlmsg_uniast
that would be GFP_KERNEL.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help