On Fri, 2012-10-05 at 14:22 +0200, Eric Dumazet wrote:
Yes, but the idea of the patch was to _avoid_ next pskb_expand_head()
calls...
yes but we cannot be sure of that, the caller may not have a good idea
of the headroom needed for the whole lifetime of the skb
it's better to think we will reduce number of calls, not avoid them
that's why I think doubling the size each time is dangerous, since we
silently request bigger and bigger allocations if an skb takes an
unoptimized path
Hmm,
this changes nothing assuming current_end == skb_end_offset(skb)
and current_head = skb->head
My idea was to leave skb->end at its last position even if we grow
skb->head.
Since we have a way to know the current allocation size of skb->head,
further pskb_expand_head() calls to request tailroom would just push
skb->tail & skb->end together if that fits in current ksize().
I've not looked at recent changes in mainline, since you changed how
skb->head is managed, that may be totally impossible.
Your proposed changed API change to expand_head will fill this anyway.
New convention would be : pass number of needed bytes after current
tail, not after current end.
Fully agree on this
--
Maxime