Thread (128 messages) 128 messages, 16 authors, 2006-08-25

Re: [RFC][PATCH 2/9] deadlock prevention core

From: Thomas Graf <tgraf@suug.ch>
Date: 2006-08-09 13:19:23
Also in: lkml, netdev

* Daniel Phillips [off-list ref] 2006-08-08 22:47
David Miller wrote:
quoted
From: Daniel Phillips <redacted>
 >>Can you please characterize the conditions under which skb->dev changes
quoted
quoted
after the alloc?  Are there writings on this subtlety?
The packet scheduler and classifier can redirect packets to different
devices, and can the netfilter layer.

The setting of skb->dev is wholly transient and you cannot rely upon
it to be the same as when you set it on allocation.

Even simple things like the bonding device change skb->dev on every
receive.
Thankyou, this is easily fixed.
It's not that simple, in order to just fix the most obvious case
being packet forwarding when skb->dev changes its meaning from
device the packet is coming from to device the packet will be leaving
on is difficult.

You can't unreserve at that point so you need to keep the original
skb->dev. Since the packet is mostly likely queued before freeing
you will lose the refcnt on the original skb->dev. Keeping a
refcnt just for this memalloc stuff is out of question. Even keeping
the ifindex on a best effort basis is unlikely an option, sk_buff is
way overweight already.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help