Re: TCP socket buffer autotuning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I fail to see how the TCP double-counting scenario. In tcp_sendmsg()
I only see "sk_wmem_queued" is charged and used to cap the amount
of memory consumed, and put the sender to sleep if necessary.

But tcp_transmit_skb()->skb_set_owner_w() and skb_orphan() both
maintain a separate "sk_wmem_alloc" for its accounting, which
doesn't seem to limit the xmit path (other than tcp_retransmit_skb()).

Am I missing something (probably :)?

Thanks,

Jerry

On 10/20/06, David Miller <davem@xxxxxxxxxxxxx> wrote:
From: John Heffner <jheffner@xxxxxxx>
Date: Fri, 20 Oct 2006 23:11:15 -0400

> I think that what's going on is that since you're using netem, tcp is
> double-counting the cloned skb's sitting in the txqueue.  Since pretty
> much the full BDP is sitting in your txqueue, you're needing about
> 2xBDP.  I think this double-counting isn't strictly necessary.  Can
> anyone think of a good reason why this is done (skb_set_owner_w() in
> tcp_transmit_skb())?  It's late and my brain may not be working right.. ;)

Indeed, netem should orphan the SKB as soon as it queues.
Try this:

diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 45939ba..ef8874b 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -170,6 +170,8 @@ static int netem_enqueue(struct sk_buff
                return NET_XMIT_BYPASS;
        }

+       skb_orphan(skb);
+
        /*
         * If we need to duplicate packet, then re-insert at top of the
         * qdisc tree, since parent queuer expects that only one

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux