Using ithread to deal with the network packet…
2009-05-13 04:02:38来源:未知 阅读 ()
I tested callout, normal kthread and ithread in my test module that add a hook in the ether_input and ether_output functions and dispatch the mbuf to the ether_demux and ether_output_frame directly.
Callout: schedules the function after given time, and must reset again. In this case, interrupt/context/cpu is average. The big problem is the packets will be delay. The value of interrupt and context are in direct radio with HZ.
Kthread: like the thread of user space, ktread use suspend or sleep to give up CPU. But in heavy network traffic, sleep is too long, even one tick, and the packet queue will be filled full in a very short time. In my test, the value of interrupt is lower, but the value of context is very high. There is no way to give up CPU freely, context is heavy while using sleep, CPU is busy while using "pause" or "rep;nop" assemble instruction.
At last, I use ithread to deal with the network packtes instead of kthread. As we know, the ithread, is the kernel thread that triggered by an interrupt. It is easy that use swi_add to register an interrupt thread.
The value of interrupt is about 230400, an increase of about 3% as compared with the normal tcp stack. The value of context reached about 32250, a 30% increase compared to the normal.
tested box: Xeon 2.4 x 2, 1G memroy, Intel GB NIC
packet generator: Smartbit 6000 with GB module, 128-512Bytes/frame.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/132/showart_145546.html
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- 提示:bad kernel: arp : 内网IP地址 is on em0 but got rep 2009-05-13
- OpenBSD 4.5 2009-05-13
- DragonFly BSD 2.2.1发布 2009-05-13
- NetBSD 5.0发布 2009-05-13
- 在windows下 grub4dos硬盘安装 不解开iso 就差一步啊 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash