Subject: Re: [PATCH] [e1000]: Remove unnecessary tx_lock

From: "Edgar E. Iglesias" <[email-masked]>
Date: Sun, 6 Aug 2006 10:06:59 +0200

On Sun, Aug 06, 2006 at 05:36:55PM +1000, Herbert Xu wrote:
> On Sun, Aug 06, 2006 at 12:26:44AM -0700, David Miller wrote:
> > 
> > Increasingly I find that orphan'ing an SKB once it hits the real
> > device for transmit is something to seriously consider.
> 
> Yes that certainly makes a lot of sense.
> 
> Actually, why do we charge the memory to the socket at all between
> the packet leaving the TCP stack and it entering the device? Most
> packets spend a tiny amount of time on this journey so it seems
> silly to do atomic operations as they leave the stack only to undo
> it when they enter the device.
> 
> The biggest reason packets spend a non-trivial amount of time on
> this journey is traffic shaping.  In that case the memory is already
> accounted to the device anyway (in terms of queue length) so it would
> seem unfair to charge the socket as well.
> 
> So how about simply charging the socket for the retransmit queue
> as we do now and skip the caharge for packets leaving the stack?
> 
> For UDP it's different since it doesn't have a retransmit queue.
> However, I'm unsure how much of a positive effect the socket charge
> actually has for UDP.

It makes sense, but I see a problem with this. It will remove some of the
control applications have on how much of their data gets queued on local
queues. Small SNDBUF's are sometimes used to somewhat avoid/control latency.

For now, I think it's better to orphan the skb when it hits a real device for
transmit, as David mentioned.

Best regards
-- 
        Programmer
        Edgar E. Iglesias <[email-masked]> 46.46.272.1946