关于tcp的prequeue的一些说明

本文探讨了TCP预排队(prequeue)机制的实现与优化,分析其在不同场景下的作用及存在的问题,并引用了实际代码修改说明。文章指出,虽然预排队对快速校验和的支持不再那么关键,但它对于调度和生成ACK仍然很重要。

Here's a patch to make that prequeue comment a little clearer. Look ok?

Signed-off-by: Andy Grover <andrew.grover@xxxxxxxxx>

===== include/net/tcp.h 1.105 vs edited =====
--- 1.105/include/net/tcp.h     2005-02-22 10:45:31 -08:00
+++ edited/include/net/tcp.h    2005-04-28 14:02:43 -07:00
@@ -1560,6 +1560,13 @@
  * idea (VJ's mail "Re: query about TCP header on tcp-ip" of 07 Sep 93)
  * failed somewhere. Latency? Burstiness? Well, at least now we will
  * see, why it failed. 8)8)                              --ANK
+ *
+ * Actually, even though the prequeue is not as important for fast
+ * csum anymore, it is important for scheduling, to generate ACKs
+ * when the data is received by the process, not the stack.
+ * davem says, "Without prequeue, we ACK immediately. This artificially
+ * makes the sender believe it can pump data out at that rate to the
+ * receiver."
  *
  * NOTE: is this not too big to inline?
  */
 

The TCP prequeue thing is based on old facts, and has drawbacks.

1) It adds 48 bytes per 'struct tcp_sock'
2) It adds some ugly code in hot paths
3) It has a small hit ratio on typical servers using many sockets
4) It may have a high hit ratio on UP machines running one process,
    where the prequeue adds litle gain. (In fact, letting the user
    doing the copy after being woke up is better for cache reuse)
5) Doing a copy to user in softirq handler is not good, because of
    potential page faults :(
6) Maybe the NET_DMA thing is the only thing that might need prequeue.

 

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值