[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9012784.ALUgdZc4HQ@n95hx1g2>
Date: Sun, 18 Oct 2020 13:59:43 +0200
From: Christian Eggers <ceggers@...i.de>
To: Vladimir Oltean <vladimir.oltean@....com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"andrew@...n.ch" <andrew@...n.ch>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"vivien.didelot@...il.com" <vivien.didelot@...il.com>,
"kuba@...nel.org" <kuba@...nel.org>,
Kurt Kanzenbach <kurt@...utronix.de>
Subject: Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure
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
Powered by blists - more mailing lists