Sunday, November 29, 2009

The Three Beggars

           by William Butler Yeats

"Though to my feathers in the wet,
I have stood here from break of day.
I have not found a thing to eat,
For only rubbish comes my way.
Am I to live on lebeen-lone?'
Muttered the old crane of Gort.
"For all my pains on lebeen-lone?'

King Guaire walked amid his court
The palace-yard and river-side
And there to three old beggars said,
"You that have wandered far and wide
Can ravel out what's in my head.
Do men who least desire get most,
Or get the most who most desire?'
A beggar said, "They get the most
Whom man or devil cannot tire,
And what could make their muscles taut
Unless desire had made them so?'
But Guaire laughed with secret thought,
"If that be true as it seems true,
One of you three is a rich man,
For he shall have a thousand pounds
Who is first asleep, if but he can
Sleep before the third noon sounds."
And thereon, merry as a bird
With his old thoughts, King Guaire went
From river-side and palace-yard
And left them to their argument.
"And if I win,' one beggar said,
'Though I am old I shall persuade
A pretty girl to share my bed';
The second: "I shall learn a trade';
The third: "I'll hurry' to the course
Among the other gentlemen,
And lay it all upon a horse';
The second: "I have thought again:
A farmer has more dignity.'
One to another sighed and cried:
The exorbitant dreams of beggary.
That idleness had borne to pride,
Sang through their teeth from noon to noon;
And when the sccond twilight brought
The frenzy of the beggars' moon
None closed his blood-shot eyes but sought
To keep his fellows from their sleep;
All shouted till their anger grew
And they were whirling in a heap.

They mauled and bit the whole night through;
They mauled and bit till the day shone;
They mauled and bit through all that day
And till another night had gone,
Or if they made a moment's stay
They sat upon their heels to rail,,
And when old Guaire came and stood
Before the three to end this tale,
They were commingling lice and blood
"Time's up,' he cried, and all the three
With blood-shot eyes upon him stared.
"Time's up,' he eried, and all the three
Fell down upon the dust and snored.

`Maybe I shall be lucky yet,
Now they are silent,' said the crane.
`Though to my feathers in the wet
I've stood as I were made of stone
And seen the rubbish run about,
It's certain there are trout somewhere
And maybe I shall take a trout
but I do not seem to care.'

Sunday, November 01, 2009

2009 BeijingLSF小记

又是一篇迟到的blog,我似乎总在记录很久以前的事情?

BeijingLSF是由Coly Li,Ma Tao, Wu FengGuang等国内一线的Linux内核IO相关的开发者发起的Linux存储与文件系统研讨会。为了节省旅行开销,这次研讨会于2009年10月24日--CLK的前一天在北邮教三召开。我有幸作为志愿者全程参与了此次盛会。

在我之前,已经有ColyLi和Wang Xu两位分别写了blog记录这次会议,连接如下:
http://blog.coly.li/?p=24
http://wangxu.me/blog/?p=275

如果对当日的PP感兴趣,请看这里:http://picasaweb.google.com/colyli/BeijingLSF2009

当日的日程如下:
9:20 – 10:00  Distributed Lock Manager - lead by Coly Li
10:20-11:00 Clustering File System - lead by Tao Ma
11:20-12:00 Shared Storage and Snapshot - lead by Xinwei Hu
13:30-14:10 VFS readahead/writeback - lead by Fengguang Wu
14:30-15:10 I/O Controller and I/O Bandwidth - lead by Jianfeng Gui
15:30-16:10 Interaction with Industry - lead by Lenovo engineers
16:30-17:10 Light Talk and Summary - 2 minutes for each
由于当志愿者的关系,我并没有完整的听到(偷:)所有的讨论,这里记录下我的见闻。

第一个talk是Coly Li介绍讨论分布式锁管理中目前遇到的问题,大家都觉得Coly选择了ocfs2中最困难的部门,对他颇为同情,同时对一些问题的细节展开了讨论。这部门我一直做打杂,没怎么听到(残念。。。)

第二个话题本来是马涛主持讨论集群文件系统,大家在这个talk之前决定来次全场的自我介绍,而自我介绍阶段大家又花了不少时间围观apt大牛,导致这个环节的时间不是很充足。好在第二天的CLK上马涛做了同样的演讲,这里我可以来八一八。目前马涛在ocfs2上实现了reflink特性,这个特性的作用是把新文件的元数据指向原文件的同一块数据块,同时用引用计数记录数据块的引用数,这样实现了多个文件共享同一个物理块,达到了节省磁盘空间的目的,与EMC的dedup有异曲同工之效。直觉上reflink特性在btrfs这样的树形文件系统中更为自然,而在ocfs2上的实现估计会有不小改动。一个好消息是reflink在将来会成为一个系统调用,这样别的文件系统也可以去实现类似的功能(btrfs上已经有类似的功能了,使用BTRFS_IOC_CLONE这个ioctl实现)。

第三个话题是胡欣慰主持讨论共享存储和快照。这部分重点阐释了drbd, dm, md的区别。想来暑期实习的时候向mentor推荐lvm,他问我有什么好处,当时没能把他说服。现在看来,lvm最吸引人的地方应该是快照功能,腾讯的OP似乎还没有意识到lvm的好处,有机会去给他们科普科普:)

第四个话题是吴峰光介绍VFS的预读和写回。这部分的代码我也在之前看过一些,所以听起来还算不怎么吃力。其中也接触到了一些新的概念,比如kernel预读的抖动等。内核预读算是文件系统和内存管理两个子系统的交集。印象最深的是吴的实现比以前更好的是把预读的位置保存在了不同的位置,使得一个文件能够有多条预读流。

第五个话题是归剑峰主持介绍cgroups的IO controller。以前对cgroups只是听说过,在听了归的介绍后,大致对IO controller的目的有了些了解,但是实现细节还是没听懂。好在后来在吃饭的时候有幸和cgroups的maintainer李泽帆坐到了一起,乘机抓了一阵狂问,总算把自己的疑惑解释的差不多了。之前不能理解的问题主要是IO控制器并不能知道当时磁盘的读写速度(因为磁盘寻道的原因,读写速度是不稳定的)。在请教了李泽帆后明白了IO控制器并不通过绝对读写速度来控制进程IO,而是通过IO的时间和读写的sector数目来控制。cgroups是个很有用的子系统,特别是在大规模计算的时候执行资源控制,以后可以多关注。

第六个话题是联想研究院的卢亿雷主持讨论他们在网盘系统开发中遇到的实际问题。这部分大家主要关注性能和数据一致性上的问题。

六个话题结束后是lighting talk,大家纷纷对组委会表达了谢意并期待明年的BeijingLSF。有好几位主动提出明年要提供赞助,足见大家的热心。会后由Intel赞助,大家一起去全聚德腐败了一顿,想不到我的第一次全聚德,居然是和这么多牛人一起吃的,太激动了~~~

总结起来,这算是国内Linux IO相关的内核开发者的第一次专门讨论会,到来的也都是活跃在Linux内核开发的一线开发者,能有这么一次近距离接触牛人的机会,真的要感谢Coly和来参见BeijingLSF的各位大牛,以及另外一位志愿者李劼,当然还有热心来帮忙的我的gf :)

附录,参会人员名单:
Bo Yang, Coly Li, Fengguang Wu, Herbert Xu, Jeff He, Jeff Liu, Jiaju Zhang, Jianfeng Gui, Michael Fu, Tao Ma, Tiger Yang, Xiao Luo, Xinwei Hu, Xu Wang, Yang Li, Yawei Niu, Yilei Lu, Yu Zhong, Zefan Li, Zheng Yan.

beijinglsf2009