On Sunday, 18 October 2020, 13:42:06 CEST, Vladimir Oltean wrote:
> On Sun, Oct 18, 2020 at 12:36:03PM +0200, Christian Eggers wrote:
> > >       err = pskb_expand_head(skb, max(needed_headroom, 0),
> > >       
> > >                              max(needed_tailroom, 0), GFP_ATOMIC);
> > 
> > You may remove the second max() statement (around needed_tailroom). This
> > would size the reallocated skb more exactly to the size actually required
> > an may save some RAM (already tested too).
> 
> Please explain more. needed_tailroom can be negative, why should I
> shrink the tailroom?
Because it will not be required anymore. This may lead to smaller memory 
allocations or the excess tailroom can be reused for headroom if needed. If 
none of both applies, the tailroom will not be changed.

regards
Christian



Reply via email to