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

Saturday, October 10, 2009

百度系统部面经

其实都过去半个月了,自己一直懒,没有写总结。。。

简单写一点吧。实验室师兄内推的,所以免去了笔试环节。内推的时候我以为至少会10月份再面试,心想着不急,还有十一长假可以准备呢,结果刚刚第二天就通知下周面试,着实让我急了一阵。不过还好,项目不是很紧,所以花了不少时间去准备,虽然准备的问题基本没有问到。。。

通知的下午2点普天7层面试,我到早了点,发短信找推荐我的师兄聊了会。师兄跟我特别强调自己会什么就说什么,不会就说不会,不要吹牛。这点我之前在看面经的时候也看到过。

一面是位很和蔼的GG,这天面试的人很多,我们就在一个花台旁边坐下来聊了起来。问的都是分布式上的东东,主要集中在DFS的设计上,说到了一些Google的DFS可以优化的地方。其他的就问了问环境变量是如何工作的,这个问题正好我准备到了,于是blabla一番。这时面试地点换到了10层。10层仍然没有位置,于是找了个空沙发两人坐着又blabla了一会。

一面结束后GG让我在那等一下,还有面试。哦,这里8一8百度的面试流程吧。之前我看的面经里面也有说到,一共是三面,一般来说三面一天面完,如果三个面试官都觉得可以的,就当场给offer,如果都觉得不行的话就当场据掉,如果意见不统一的话就进pending list。

二面是位JJ,也非常nice。一来就说我的background和他们的需求非常match,弄得我心里一阵感激。JJ上来也问分布式,简单blabla一番后,开始问项目。因为我有写对Linux文件系统比较熟悉,就问了几个文件系统相关的问题,如ext2/3/4的区别,ext4的数据块分布结构,ext3如何保证磁盘数据一致性,日志文件系统是否能够完全保证数据一致性等问题。完了还说部门有分布式和kernel两个组,问我想去那个组,能不能去实习,说如果能去实习的话对以后拿户口有帮助之类,心里再次泛起一阵感激。

二面结束后让我再等一下,还有三面。三面过来了两个GG,一看就知道是技术大牛的那种。前两面一直比较轻松,我心想这下危险了。三面从简历上的项目经历问起,这部分没什么问题,于是blabla。项目问完后就开始问内核,ext4的extent tree在磁盘上是什么数据结构。说实话这个问题我一直没考虑过。。。想了一会儿后放弃。。。出来之后才觉得自己当时傻了,简单画一画就知道是btree了。。。sigh。不过这只是开头,然后又问了ext2和ext3在块分配算法上有什么区别。在ext2分区上,命令touch a会让内核完成哪些操作,echo "hello" >> a又会完成哪些操作,for i in `seq 10000`;do echo "hello" >> a;done又会完成哪些操作。接着问ext4在这方面有什么改进,delayed allocator和以前的allocator有什么区别,有哪些好处和劣势,mballocator的分配算法等。还问了ext4的delayed allocator造成空文件的原因,这个问题以纠正我长久以来对delayed allocation的一个误区结束。这之后就没有什么问题了,kernel team的那位GG问我有没有什么要问的,我自我感觉表现的不怎么样,还是鼓起勇气问了下什么时候能出结果,GG说要等他们商量之后才知道。

三面完了之后又过来了一位帅GG,自我介绍中知道原来是系统部的技术经理,仰视ing。寒暄了一阵后GG说现在还决定不了,要到10月中旬hr部门才能发正式的offer。我心里一下就凉了,想完了,这下进waiting list了。GG也看出了我的表情变化,微笑着说不过现在可以给我一个口头的。想不到leader还挺会逗人的。。。之后还是问有没有什么问题,能不能去实习之类的。然后留了下联系方式,说有什么问题可以直接给他打电话,再次感激ing。然后leader送我出去,我不是很放心,出门的时候再次跟leader确认了一下,leader说应该没问题,自己才放心一些。

下电梯后给师兄发了个短信,说拿到口头offer了,改天请师兄吃饭。

腾讯公司soso产品部门暑期实习总结

It is said that a starting "so" will give me valuable micro-seconds to put one more thought on a rational article.

So, I'm gonna blog about my summer internship at soso product center of Tencent Inc, finally.

标题太严肃,所以酸一段E文,调节调节:)

在腾讯的实习时间不长,从7月22日入职到8月30日离开,前后只有一个月多点。但是,我认为我度过了一段很充实,也很开心的时间。

运营管理组是个非常有活力的项目组。我的mentor(貌似也是组内很多人的mentor)kypoyin非常有才华和远见,他一手主导和推动了分布式文件系统和mapreduce项目的设计和开发,而且总是能站在一定的高度看问题,把很大的一个工程梳理得井井有条。在他身边做事会有种自己也跟着变得更聪明的感觉:)

组长dave是位很和蔼的头儿,对下属基本使用自觉管理方法。soso自己的搜索引擎上线的时候还亲自连续通宵值班,敬业精神是在可敬。

qqzhang属于特别勤奋的那种,据说工作一年多,绝大部分时间是晚上10点回家。我查过svn log,qqzhang贡献了将近一半的commit,绝对猛男!我写complexIO的时候kypo很忙,很多问题都是找qqzhang帮忙解决的,再次真诚地感谢一下:)

reno不愧是北大高才生,基础超级扎实,对所有自己涉猎的问题都理解深刻,各种问题到了他这里都不再是问题,名副其实的问题终点站。

vino姐姐是组内的开心果,我报到的第一天的午饭就是vino带我吃的桂林米粉,第一次吃这么好吃的米粉。vino人非常好,特别亲切,一起出去吃饭的时候总是很大方的贡献自己的iphone给大家玩游戏,某次还突然跟我说你去买一个iphone吧,弄得我一脸迷茫。可爱之极。

xuekouying(抱歉因为觉得你的名字很好听,我一直不记得你的nickname)是坐在我帮边的一位很踏实的JJ,对于各种自己不清楚的问题都很努力地去学习。记得高中的时候班主任告诉我们什么样的人可以去做科学家的时候说,不是最聪明的人也不是知识最丰富的人可以做科学家,只有不断探索,不断学习的人才能成为科学家。相信xuekouying会在数据挖掘的路上越走越好。

warmer是在我入职两个星期后从深圳培训回来的,emacs大牛。一直认为会玩emacs的都是神人,warmer果然不负这个论断。warmer的奢侈品小键盘也着实让大家眼红了一把,米人啊!

其他的同事因为不是很熟悉,这里就不一一列举了。大家平时最多的消遣活动就是玩桌上足球。我第一次玩的时候是和kypo搭档,结果被reno和qq两人剃了光蛋,真是对不起kypo,害得你陪着我成为组内的垫底记录保持者。。。不过我经过一个月的锻炼,已经可以在后卫线上独当一面了。当然前锋还不行,中场有五个小人,我还控制不过来。让我非常感动的是,在我离开的那天晚上,组内的同事们还非常热心的开party为我送别。一行人一起K歌然后出去吃夜宵直到11点才散去。这真是个让人舍不得的集体。

实习的这段时间里自己也确实做了些事情,大部分时间是工作到晚上9点以后才回去的,偶尔周末也加加班,完成的任务包括:
1. DFS(Distributed File System)与本地文件系统的接口封装
2. DFS merge功能的设计实现
3. DFS 移植到FUSE (Filesystem in USErspace)
4. mapreduce接口类序列化
5. mapreduce的缓存服务DataCache的设计和实现

回头看一下,这里面的1和4后来都被返工了。1是因为自己当时对接口也不熟悉设计得太烂(sigh。。。)。4是因为mapreduce的接口最初设计得不是很合理,后来完全推翻重做。通过这些任务,我对google的GFS和mapreduce设计框架有了大致的认识,了解到这样的大型基础架构的设计要点,可以说在分布式存储和计算方面获得了很好的实践经验。当然也犯过错误,我对DFS client的一个判断语句的修改导致不能传输大文件,这个bug甚至影响到了我离开后的一个演示任务,实在是对不住各位同事的努力,以后有机会一定请大家吃饭赔罪。这个问题也反映出我对自己的代码测试不够充分的问题,这点是我必须要注意的,以后对提交的代码一定要做充分的测试。

总的说来,这段时间我过得非常开心,尽管有时候很忙也有些累,但是过得很充实,能够真真切切地感受到自己的成长。一个不断成长的自己,这也是我一直的追求。感谢上天给我这么好的机会,和一群很有卓越见识且心地善良的人一起工作,回想起来,这也是我当初选择计算机专业的原因。最后套用vino的blog标题做结束语,C'est la vie,我喜欢这样的生活。

Monday, August 31, 2009

2009年8月linuxfb.org版聚总结

到场人员名单:

gmoto & gery: 做gsoc做了五个月,终于做完了,前几个月的苦瓜脸终于变成了笑脸
,今天粉丝团就来了一个

hzmangel: blabla,english 太快没有听清楚,未婚

colyli: 忽悠大家来聊天,最近推的招牌是gmoto,希望大家多宣传

JP: 1999 on gnome, preload oem work currently, Novell Linux desktop manager

xt9876: 电子科学与技术,大四,完了三年Linux,在北邮人论坛,做过S3接口计算
,平时做Linux相关,未婚

wentws: xt9876同学,选了唐sir的课,对Linux感兴趣,接触一年左右,unmarried

jackydude: 来了几次了,对coly, gmoto印象深刻,做过嵌入式,对gmoto工作非常
感兴趣,gmoto粉丝

jokerlee: 玩Linux快三年了,对底层感兴趣,最近在看kernel

epico: from Novell, work on firefox for suse Linux.

bergwolf: 计算机研三,未婚

eMBee: BLUG友人

robert: 从Intel来的嘉宾




感觉离上次版聚已经很久了的样子,呵呵。虽然已经到了八月的倒数第二天,我们八月的版聚终于还是成形。这次来的人不多,可是丝毫没有减少我们对开源对技术的兴趣。大家都非常踊跃地参与讨论,思想碰撞中有了不少美妙的火花。


第一个topic是gmoto同学总结自己的GSoC。gmoto通过从一个夏天的努力(据gmoto本人批注,实际上这个夏天从春天开始,到秋天结束),终于顺利地完成了把opensuse移植到gdium上的任务。gmoto的面容也从开始的苦瓜脸(quoting colyli)转变成为现在欢乐的笑容。gmoto在大概一个半小时的时间中,从自己编译kernel,交叉编译base system开始,如数家珍地介绍了自己在这段时间里经历的种种磨难和考验,然后成功演示了opensuse on gdium。看着自己学生的工作成果在真机上顺利运行,coly同学露出了满意的笑容。同时恭喜gmoto同学顺利通过GSoC final evaluation!

第二个topic是临时决定的--由来自BLUG的友人eMBee介绍最近大家身边将要发生的一些events。首先是9月5日的coding for fun,然后是9月8日的blug meeting(big news:这次的blug meeting我们将迎来libc的maintainer Ulrich Drepper),接着是今年的free software day(eMBee诚邀大家去FSD演讲topic,有兴趣的童鞋请联系eMBee@freenode.net)。最后eMBee介绍了一个宣传使用互联网和开源软件做学术研究的组织wiserU--他们目前需要懂计算机的同学去帮忙他们宣传,有兴趣的同学请联系eMBee)

第三个topic是colyli介绍今年夏天在中科院参加的一个CPU cache design的training。coly从最简单的direct map cache介绍起,深入浅出地介绍了包括set-associate,multicolum cache在内的几种经典cache。由于在场的同学对这方面都有所了解,大家针对colyli的介绍展开了深入讨论,同时colyli沉稳地接受大家的挑战并一一解答了在座各位心中的疑惑。

总的来说,这次久违的版聚再次给大家一种不虚此行的感觉。特别是在讨论cache design的过程中,详细的回味了早就丢在脑后的计算机组成原理,同时学习到了multicolum这种设计。感谢三位同学的精彩演讲,期待下次版聚。

Saturday, August 15, 2009

OpenSUSE conference proposal被拒

注定是无收成的一年啊。。。sigh

Dear Peng Tao,

Thanks very much for your submission to the openSUSE Conference. Unfortunately, we were not able to accept your talk for this year's event. We appreciate the submission, but we had many great proposals and were only able to accept a limited number of proposals. Thanks very much for your interest, and we hope to see you in September at the conference. Note that we still offer birds of a feather sessions, and you are welcome to present your topic as part of the "unconference."

Best,

Joe Brockmeier

Thursday, July 23, 2009

2009年7月22日,日全食

我却没有看到。

传说百年一遇的天文奇景,东起西藏,西至上海--北京只能可怜巴巴的看到偏食,像在一次盛大的聚会中蹭食的小丑一样--我却没有看到,因为天空阴云密布。现在仍然对小时候看到日偏食的情景记忆犹新--火红的太阳从东方升起来的时候就像被咬了一口一样,古人的“天狗食日”说还真是形象。

日食本是一件非常让人兴奋的事情,今天的我却怎么也兴奋不起来。不知是不是因为最近心烦的事情太多,导致无心去欣赏生活;抑或对生活已然麻木,任百年奇观亦无法提起兴趣。明明上周在雍和宫就下定决心要平静下来的,我还是太过浮躁,导致对日食这样的事情也提不起兴趣。活的如行尸走肉。

对我而言,7月22日并不是个好日子。去年的今天,是父亲发病的日子。现在想起母亲给我说的当时的情景,我仍然感觉触目惊心,如梦,心痛。那日,父亲正在打牌,突然犯病,从椅子。。。原谅我,我仍然无法心平气和地把当时的情景记录下来。这是我一辈子的记忆,虽然我没有用文字记载它。

如今,生活多是无赖,也鲜有好消息让人兴奋。都说穷人的孩子早当家,我虽然已经到了当家的年龄,却总是在寻找逃避的借口。一直知道会有那么一日,不再拥有父母的保护伞,不再能够在受伤时回到温暖的避风港,不再听到失败是成功之母的教诲,我会不得不撑起一片自己的天空。

那日,即是今日!
That day, is today!

今天,去腾讯soso产品部门报到了。team有两个方向--数据挖掘和分布式文件系统。一直认为数据挖掘的水太深,我这样肤浅的人是不适合的,所以在mentor问到自己将来的打算的时候,明确地说了希望加入到分布式文件系统组中。最近一年来在文件系统方面的积累,希望能在这次的暑期实习中有所体现,即使最后没能留在腾讯,对我而言也算是不小的安慰了。

Tuesday, July 14, 2009

First kernel patch

真正意义上的第一个kernel patch(之前给documentation有一个patch,但那不算coding:)。值得纪念的日子,留博一篇。

在ext4 w/o journal模式下,ext4 online resize的两个ioctl不应该提交清空journal的要求,否则会造成一个null pointer的kernel oops。

commit ac046f1d6121ccdda6db66bd88acd52418f489b2
Author: Peng Tao
Date: Mon Jul 13 09:30:17 2009 -0400

ext4: fix null handler of ioctls in no journal mode

The EXT4_IOC_GROUP_ADD and EXT4_IOC_GROUP_EXTEND ioctls should not
flush the journal in no_journal mode. Otherwise, running resize2fs on
a mounted no_journal partition triggers the following error messages:

BUG: unable to handle kernel NULL pointer dereference at 00000014
IP: [] _spin_lock+0x8/0x19
*pde = 00000000
Oops: 0002 [#1] SMP

Signed-off-by: Peng Tao
Signed-off-by: "Theodore Ts'o"

Tuesday, April 21, 2009

GSoC 2009申请总结

sadly,今年的Google Summer of Code对我而言已经结束了,恭喜几位申请上的同学,同时小小的悲伤下自己的失败,sigh。。。

总结起来,这次申请失败很大的一个原因是当初选择项目的时候没有考虑mentor的因素。我申请的Maemo社区的mainlining N800/N810 kernel。之所以选择这个项目,一来是自己还是想做kernel相关的project,二来是实验室正好在做Maemo平台的项目。但是我忽略了很重要的一点,打算指导这个项目的mentor把自己的名字写在了好几个项目的后面——这意味着我还需要和不同项目的学生直接竞争,因为mentor最后(大多)是只会指导一个项目的。而且这也影响了申请阶段和mentor之间的交流。在写proposal那段时间,我几乎没有和mentor有什么交流,每次去问问题,他总说没很忙没时间,just submit it。或许这次申请失败从那个时候开始就注定了。这也反映出我长期的一个坏习惯——做事情只是从自己的角度考虑,选择最佳方法,而忽略了其他相关的方面。但世事不总是那么straightforward,所以我需要学习,从更全面的角度去思考问题,更缜密的考虑解决方案。

另外一个教训是不要被表象所迷惑。我刚刚提交申请当天,就得到了Maemo社区这次GSoC的组织者的很好的评价。其后又有两个mentor(包括愿意指导这个项目的mentor)的很positive的comments。但是最后我还是落选了。可见public review并没有想象中的那么重要。而mentor对项目是否积极回应,应该在很大程度上决定项目是否会落选。

Saturday, April 04, 2009

proposal for maemo 09 GSoC:mainlining N800/N810 kernel

Abstract:

The Maemo Diablo kernel is based on the 2.6.21 version of linux-omap kernel, which is too old now. And since the mainline kernel is the desired target for all merging processes, it is more appropriate to base the Maemo kernel on the mainline kernel. This project aims to get drivers from Maemo's Linux kernel to the mainline (Linus's 2.6.30+) kernel release, patch the mainline kernel with WiFi support from the stlc45xx driver, and boot the mainline kernel in N800s and N810s.

Content:
  • Project title.

Mainlining the N800/N810 kernel

  • Project Abstract (short description).

The Maemo Diablo kernel is based on the 2.6.21 version of linux-omap kernel, which is too old now. And since the mainline kernel is the desired target for all merging processes, it is more appropriate to base the Maemo kernel on the mainline kernel. This project aims to get drivers from Maemo's Linux kernel to the mainline (Linus's 2.6.30+) kernel release, patch the mainline kernel with WiFi support from the stlc45xx driver, and boot the mainline kernel on N800s and N810s.

  • Project full description.

Maemo Diablo is still running on a patched 2.6.21 omap kernel, which is too old and missing some new features. It's time to rebase Maemo Diablo kernel on a vanilla kernel. This project aims to get the mainline kernel working for N800/N810 devices, and use the new stlc45xx WiFi driver in the mainline kernel. To do this, the vanilla kernel must be patched with several drivers from the Maemo kernel and the linux-omap kernel.

Because many N800/N810 hardware drivers (such as the N800/N810 board drivers) haven't made their way into the mainline kernel, my first goal would be porting enough hardware drivers from linux-omap tree to make the mainline kernel bootable on N800/N810.

The Maemo 5.0 kernel is ready rebased on the 2.6.28 vanilla kernel[1]. I tried to apply the Maemo 5.0 kernel patch to a 2.6.29 vanilla kernel. Most of it applied, with some already merged and a few failures. Therefore, I can generate a new patch based on the Maemo 5.0 kernel patch and make it applicable to a newer mainline kernel (currently 2.6.29, in the future 2.6.30+). By doing this, I will get a bootable kernel on N800/N810 having all hardware supported. The DSP gateway drivers are also included in the Maemo 5.0 kernel patch. The original project idea on Maemo GSoC wiki skipped the DSP gateway support, but it should be supported here.

The next goal is to get N800/N810 booting with WiFi support from stlc45xx. Stlc45xx is an open source WLAN driver based on mac80211 for Nokia N800 and N810 devices. Nokia has been contributing a lot to the stlc45xx driver. It's time to make it usable for Maemo users.

However, stlc45xx is based on the linux-omap tree[2]. There might be problems getting it working on top of Linus's tree. So first I need to find out what stlc45xx needs from linux-omap tree. If something is missing in Linus's tree, I have two options then: either apply the missing commits from linux-omap tree to Linus's tree (preferred), or fall back to an older version of stlc45xx that is supported by Linus's tree.

  • Project tasks and deliverables.

As described above, there are basically two goals for this project:
1. Port missing drivers to make the mainline kernel bootable on N800/N810.
2. Port stlc45xx driver to the mainline kernel, and boot N800/N810 with WiFi support.

At the end of GSoC 2009, I will be submitting the following deliverables:
1.A binary image (built on Linus's tree) that will boot on N800/N810 with all hardware supported and WiFi support from stlc45xx.
2. A patchset against latest Linus's tree that has all changes necessary to build a
working kernel image, as well as corresponding .config file.
3. A website that records every problem I meet and how I solve it. And there will be a summary on my experience of patching the Linux kernel and upgrading the N800/N810 kernel. I plan to place a site on my googlepages (as I did last year), but it can be relocated upon request.
4. A detailed developer guide demonstrating how to collect Maemo Diablo patches, apply them to the vanilla kernel, compile the kernel and flash it into N800/N810 devices. A summary on using stlc45xx driver in N800/N810 will be included too.

  • Project schedule.

To complete above tasks, I have a brief timeline as follows:
Before May 23, get familiar with the Maemo kernel, compare mainline kernel with Maemo kernel and collect what is missing in the mainline kernel.
May 23 - May 29, port N800/N810 drivers from Maemo 5.0 kernel to the mainline kernel, and resolve conflicts.
May 30 - June 5, build/flash/test/debug
June 6 - June 12, build/flash/test/debug. Should have a bootable mainline kernel here.
June 13 - June 19, generate a patch set against the mainline kernel.
June 20 - June 26, collect what stlc45xx depends on linux-omap tree and is missing in vanilla kernel.
June 27 - July 3, write documents and prepare for midterm evaluation.
July 4 - July 10, port stlc45xx and necessary dependencies to mainline kernel, resolve conflicts.
July 11 - July 17, build/flash/test/debug.
July 18 - July 24, build/flash/test/debug. Should have WiFi support in mainline kernel.
July 25 - July 31, write test cases (especially for the stlc45xx driver).
Aug 1 - Aug 7, scrub code, generate a patch set which includes WiFi support, and improve documentation.
Aug 8 - Aug 10, prepare for final evaluation and submitting.

  • Do you have other commitments during the summer of code coding period ? If yes, what kind of commitments ?

No. I will be a full-time participant.

  • Why are you the right person for this project ?

Basically, I am the right person for the following reasons:
1. Solid programming skills. I've been writing C/C++ programs in Linux for over 3 years.
2. I'm familiar with Linux kernel drivers and the kernel community. I have
been working with kernel drivers and kernel community since last year's
GSoC (see the biography section). I also send patches to e2fsprogs.
3. Because I am developing some N810 user-land applications in my lab, I
already have an N810 at hand which can be used for testing
conveniently. I've been playing with it for some time.
4. Last but not less important at all, I have a passion for open source and Linux
kernel hacking. I have read a lot of code in the ext4 directory last year, and this year, I've been reading the code of logfs (a scalable flash filesystem trying to make its way into mainline) in my spare time. Currently, I am still following the ext4 mailing list and have learnt a lot there.

  • What are the benefits of your project for the Maemo Community ?

1. A bootable latest mainline kernel that brings in new features for all Maemo users.
2. Plenty of documents guiding Maemo users to use stlc45xx drivers and showing developers how to patch/test/debug the Maemo kernel.
3. A well documented GSoC project that can be used as a good example for future advocating.

  • Short Biography (academic work, open source background and other activities that you like to do).

My name is Peng Tao. I'm a postgraduate from China majored in computer science. I completed another GSoC project for openSuSE mentored by ColyLi last year. It enables GRUB legacy to boot on ext4 partitions. Since then, I have been following the ext4 development and sent several patches to e2fsprogs. Besides that, I am an active member of linuxfb.org and BLUG (Beijing Linux User group). I also gave speeches on open source topics at linuxfb.org meetings, BLUG meetings, Novell/Intel OTC workshop, and Gnome Asia Summit 2008.

Here are some useful links for my background:
My blog: http://bardofschool.blogspot.com/
My resume: http://bergwolf.googlepages.com/resume
The GSoC 2008 project I completed: http://bergwolf.googlepages.com/grub4ext4

References:
[1] http://repository.maemo.org/pool/maemo5.0alpha/free/k/kernel/
[2] http://stlc45xx.garage.maemo.org/