Subject: Re: [PATCH] TX_RING and packet mmap

From: Evgeniy Polyakov <[email-masked]>
Date: Tue, 21 Apr 2009 17:56:27 +0400

On Tue, Apr 21, 2009 at 03:16:49PM +0200, Johann Baudy ([email-masked]) wrote:
> Yes but in this case, it will be called twice, as shared info (that
> contains destructor) is memcopied to new expanded head.
> shared info destructor will be excuted two times on "same" data
> (during skb_expand_head() and during kfree_skb())
> Actually, I want to know if this behavior is intended with a new
> shared info destructor.

It depends on your task... You can always store a pointer in the
tree/hash and check it in the destructor, you can play some games in the
expand helper not to call destructor: like messing with the reference
counter and reusing the old area, or silently freeing old area without
destruction invocation (presumably with some new helper).

Moreover you can allocate skb so that no matter what but it could not be
reused by the underlying layers, so it could be fully copied. In this
case usual destructor is enough.

-- 
	Evgeniy Polyakov