文章归档

tcp拥塞控制

Transmission of packets from TCP sender is restricted by the congestion window. On reception of Ack TCP sender may increase the congestion window. At the start of TCP connection sender is in slow start wherein congestion window starts growing exponentially from a small value (typically 2) till a threshold is reached. After reaching the threshold TCP enters congestion avoidance phase and increments the congestion window linearly.

Congestion avoidance state machine

Event such as arrival of dupack, SACK and Explicit congestion notification indicate a possibility of congestion due to excess transmission of packets by the sender. These events are processed through

»» 继续阅读全文

奔腾年代

不能因为他有一点瑕疵,我们就抹杀他的天赋

好片,看的真是热血沸腾,主要有几点:

  1. 胸怀梦想,纯粹的令人感动
  2. 不断的挑战自身极限,不管失败多少次,都要努力登上顶峰。
  3. 还有他和沃夫之间的这段友情

这种感受,和 当幸福来敲门 一样,从这里我们都似乎看到了自己的影子

 

The new hlist api for linux kernel

今天在写list的时候参考了linux kernel的list实现,发现内核hlist的实现还有一个可以改进的地方,当前linux版本为 redhat 2.6.32-358.14.1.el6.x86_64 关键是这两个API,list_for_each_entry和hlist_for_each_entry

/** * list_for_each_entry - iterate over list of given type * @pos: the type * to use as a loop cursor. * @head: the head for your list. * @member: the name of the list_struct within the struct. */ #define list_for_each_entry(pos, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member); \ &pos->member != (head); \ pos = list_entry(pos->member.next, typeof(*pos), member)) /** * hlist_for_each_entry - iterate over list of given type * @tpos: the type * to use as a loop cursor. * @pos: the &struct hlist_node to use as a loop cursor. * @head:

»» 继续阅读全文

The Design of a High-Performance File Server

老论文了,Bullet file Server,文献原址:http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.38.5481&rep=rep1&type=pdf

key point:

  1. to do away with the traditional file server's block model. In fact, we have chosen the extreme, which is to maintain files contiguously throughout the system. That is, files are contiguously stored on disk, contiguously cached in RAM, and kept contiguously in processes’ memories. This dictates the choice for whole file transfer.
  2. Another design choice, which is closely linked to keeping files contiguous, is to make all files immutable. That is, the only operations on files are creation, retrieval, and deletion; there are no update-in-place operations. Instead, if we want to update

    »» 继续阅读全文

NAPI: the new device driver packet processing framework

在napi方式还没有出现之前,网络数据包的接收过程大概是这样的:

  1. 数据包达到网卡,硬中断,中断处理程序处理数据包,调用netif_rx()将数据包放到cpu队列
  2. 然后出发软中断去调用net_rx_action()函数,内核将cpu队列中的数据包送到网络层

napi要解决的问题是:

  • Interrupt mitigation: High-speed networking can create thousands of interrupts per second, all of which tell the system something it already knew: it has lots of packets to process. NAPI allows drivers to run with (some) interrupts disabled during times of high traffic, with a corresponding decrease in system load.
  • Packet throttling :When the system is overwhelmed and must drop packets, it's better if those packets are disposed of before much effort goes into processing them. NAPI-compliant drivers can often cause packets to be dropped in the network adaptor itself, before

    »» 继续阅读全文

数据结构对齐问题

昨天去了迅雷,有个笔试基础题,结构体对齐相关,sizeof关键字值。回来后感觉不太确信,于是回头翻了翻lcc编译器的代码,看了结构体字段相关的处理过程。 几个基础的数据结构,其中

  • Metrics表示数据类型的大小,对齐值,autofline目前不太清楚
  • 结构体类型是通过type中的u.sym表示的,里面包含一个field类型的链表

typedef struct metrics { unsigned char size, align, outofline; } Metrics; struct type { int op; Type type; int align; int size; union { Symbol sym; struct { unsigned oldstyle:1; Type *proto; } f; } u; Xtype x; }; struct field { char *name; Type type; int offset; short bitsize; short lsb; Field link; };

在x86平台上,基础类型的Metries值(分别是 size align outofline)如下:

Interface x86linuxIR = { 1, 1, 0, /* char */ 2, 2, 0, /* short */ 4, 4, 0, /* int */ 4,

»» 继续阅读全文

some developer tools

Performance tools: ifstat(1), iftop(8), iostat(1), mpstat(1), netstat(1), nfsstat(1), nstat, vmstat(1), xosview(1) Debugging tools: htop(1), lslk(1), lsof(8), top(1) Process tracing: ltrace(1), pmap(1), ps(1), pstack(1), strace(1) Binary debugging: ldd(1), file(1), nm(1), objdump(1), readelf(1) Memory usage tools: free(1), memusage, memusagestat, slabtop(1) Accounting tools: dump-acct, dump-utmp, sa(8) Hardware debugging tools: dmidecode, ifinfo(1), lsdev(1), lshal(1), lshw(1), lsmod(8), lspci(8), lsusb(8), smartctl(8), x86info(1) Application debugging: mailstats(8), qshape(1) Xorg related tools: xdpyinfo(1), xrestop(1) Other useful info: collectl(1), proc(5), procinfo(8)

李鸿章遗折

奏为臣病垂危,自知不起,口占遗疏,仰求圣鉴事。窃臣体气素健,向能耐劳,服官四十余年,未尝因病请假。前在马关受伤,流血过久,遂成眩晕。去夏冒暑北上,复患泄泻,元气大伤。入都后又以事机不顺,朝夕焦思,往往彻夜不眠,胃纳日减,触发旧疾时 作时止。迭蒙圣慈垂询,特赏假期,慰谕周详,感激涕零。

和约幸得竣事,俄约仍无定期,上贻宵旰之忧,是臣未终心事。每一念及,忧灼五中。本月十九夜,忽喀血碗余,数日之间,遂至沉笃,群医束手,知难久延。谨口占遗疏,烦臣子经述恭校写成,固封以俟。

伏念臣受知最早,蒙恩最深,每念时局艰危,不敢自称衰病。 惟冀稍延余息,重睹中兴。赍志以终,殁身难瞑。现值京师初复,銮辂未归,和议新成,东事尚棘,根本至计,处处可虞。窃念多难兴邦,殷忧启圣。伏读迭次谕 旨,举行新政,力图自强。庆亲王等皆臣久经共事之人,此次复同更患难,定能一心效力,翼赞讦谟。臣在九泉,庶无遗憾。至臣子孙,皆受国厚恩,唯有勖其守身读书,勉图报效。属纩在即,瞻望无时,长辞圣明,无任依恋之至。谨叩谢天恩,乞皇太后、皇上圣鉴。谨奏。

Unreliable Guide To Locking

- rusty Unreliable Guide To Locking

简单来说,就两个要点:

  1. 跨上下文要避免抢占
  2. 上锁过程是否可以睡眠

http://blog.pipul.org/2012/11/锁/

linux内核设计模式

  1. http://lwn.net/Articles/336224/
  2. http://lwn.net/Articles/336255/
  3. http://lwn.net/Articles/336262/
第 7 页,共 13 页« 最新...56789...最旧 »