Thursday, July 23, 2009
2009年7月22日,日全食
传说百年一遇的天文奇景,东起西藏,西至上海--北京只能可怜巴巴的看到偏食,像在一次盛大的聚会中蹭食的小丑一样--我却没有看到,因为天空阴云密布。现在仍然对小时候看到日偏食的情景记忆犹新--火红的太阳从东方升起来的时候就像被咬了一口一样,古人的“天狗食日”说还真是形象。
日食本是一件非常让人兴奋的事情,今天的我却怎么也兴奋不起来。不知是不是因为最近心烦的事情太多,导致无心去欣赏生活;抑或对生活已然麻木,任百年奇观亦无法提起兴趣。明明上周在雍和宫就下定决心要平静下来的,我还是太过浮躁,导致对日食这样的事情也提不起兴趣。活的如行尸走肉。
对我而言,7月22日并不是个好日子。去年的今天,是父亲发病的日子。现在想起母亲给我说的当时的情景,我仍然感觉触目惊心,如梦,心痛。那日,父亲正在打牌,突然犯病,从椅子。。。原谅我,我仍然无法心平气和地把当时的情景记录下来。这是我一辈子的记忆,虽然我没有用文字记载它。
如今,生活多是无赖,也鲜有好消息让人兴奋。都说穷人的孩子早当家,我虽然已经到了当家的年龄,却总是在寻找逃避的借口。一直知道会有那么一日,不再拥有父母的保护伞,不再能够在受伤时回到温暖的避风港,不再听到失败是成功之母的教诲,我会不得不撑起一片自己的天空。
那日,即是今日!
That day, is today!
今天,去腾讯soso产品部门报到了。team有两个方向--数据挖掘和分布式文件系统。一直认为数据挖掘的水太深,我这样肤浅的人是不适合的,所以在mentor问到自己将来的打算的时候,明确地说了希望加入到分布式文件系统组中。最近一年来在文件系统方面的积累,希望能在这次的暑期实习中有所体现,即使最后没能留在腾讯,对我而言也算是不小的安慰了。
Tuesday, July 14, 2009
First kernel patch
在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: [
*pde = 00000000
Oops: 0002 [#1] SMP
Signed-off-by: Peng Tao
Signed-off-by: "Theodore Ts'o"
Tuesday, April 21, 2009
GSoC 2009申请总结
总结起来,这次申请失败很大的一个原因是当初选择项目的时候没有考虑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
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/
Wednesday, December 31, 2008
写在2008的尾巴上
看着一片人的总结,我也想总一下(似乎刚刚才总结过。。。我不管,再总一次,那篇太沉重,有些压得人喘不过气来)。
2008年发生了很多事:
1. 南方大雪。最冷的时候我们还没放假,所以我没有遇到火车被拦在半路或者家里连续一个星期下雪。燕早早的回家了却在家里受冻。我可怜的宝贝,我多想时刻在你身边,用我的体温温暖你的身体:)
2. 地震。颠覆天府之国的地震给无数的川人家庭带来了毁灭性的打击。虽然我家的屋梁歪了墙也裂了,但所幸家人都平安。人没事就好,真的。其他的一切,我们都能克服。
3. GSoC。很感谢Coly给了我这么好的机会,让我体会到开源社区的强大。目前算是对文件系统部分有了入门级的了解,以后还得更加努力。能找到件自己喜欢的事情是很不容易的。很幸运地,我找到了:)
4. 父亲生病。祸不单行,这对我家无疑是比地震更大的打击。我们全家现在也还在和病魔战斗着,我们不怕,我们的心在一起,没有什么困难克服不了。
5. 项目。SEI项目总算走上正轨了。王老师也分了很多活给我。我得感谢他,终于不再每天在实验室虚度时光了。
2009年的计划很简单:
1. 好好做完SEI项目。
2. 多看看内核,争取做几个patch出来。
3. 开始写blog,内容主要是内核Document目录下文档的理解和应用。
4. 及时行乐。不要再为一些无谓的事和家人,和女朋友生气。遇事多想想我还有哪些地方说的或做的不够好。生命短暂,我应该抓紧时间爱他们。
5. 坚持锻炼。大学以来身体越来越差,我要坚持打篮球,至少每周两次。
6. 当然啦,2009年,暑假要去实习,年内我要找个好工作。
Tuesday, December 30, 2008
2008年年终总结--影响我生命的那些事
2008年发生了很多事,其中一些对我的影响甚至超过了过去的23年发生的事情,以致我现在写总结的时候甚至只能记起这么几件,影响我生命的事。
1. 地震。没有任何预兆,八级地震,在汶川,在我的家人身边发生了。那是魂不守色的一个月,日夜只能盯着电脑,等着新消息的出现。甚至为此看了不少地震预测方面的论文和资料。地震对我家的破坏到现在也尚未修复,我也第一次开始考虑四川是否还是适合长期居住的地方。地震击毁了我的家园,但是没有击溃我们的心。那段时间,每天早晚骑车来往于大运村和学校之间的路上都是我和家人通电话的时间。亲情的温馨抚慰着被地震破坏的心。我们在地震之后变得更加坚定团结。
2. GSoC。如果没有这次Google Summer of Code,或许我就要用一无所获来形容我的2008年了。有幸受到ColyLi的青睐,我凭借grub4ext4入选了2008 GSoC并顺利完成项目。以此为契机,在ColyLi的指导下,我开始步入开源社区和Linux内核开发社区。事业上总算有了一个还算比较好的开端,也为明年找工作打下了一定基础。
3. 父亲生病。生活总是在人最不经意的时候给人狠狠的一刀,这句话一点没错。父亲脑溢血对我们一家人无疑是致命的打击。母亲开始还一直瞒着我,怕我担心。后来四姑的电话让我起疑,母亲在我一再逼问下才告诉我。赶回家的时候父亲刚刚度过危险期。直到现在,父亲仍然和病魔战斗着。我知道,如果我不能做出一番事业,我就对不起父亲的爱。这是我必须承担的压力。
即时行乐。这是2008年的噩耗们教给我的。亲人在不知道什么时候就会从身边离开。乘着还有机会,我需要更加努力地善待他们,给予他们我全部的爱和关怀。
Saturday, December 27, 2008
我不要优越的生活,亦勿需快乐
------------------------------------------------------
发信人: qianning (纤凝), 信区: Memory
标 题: 突岩深缝妙香稠-我曾是一个贫困生mm
发信站: 水木社区 (Sat Dec 13 13:32:47 2008), 站内
今天忽然想起高中班主任送我的这句诗,
其实我家本来不贫困,高三那年母亲患了脑癌,
高三要买很多复习题,那时候家里到处都需要钱,
大学开学了,我拿着家里凑的3000块钱,
那时候系里发贫困生补助的时候,
我是小地方来的学生,知识很有限,所以上课很少发言,
大四我拿到的最大的一笔奖学金是来自国外一个银行,
再后来,我保送研究生,然后拿到了很多很多奖学金。
那么多年,我都没掉过几滴眼泪。
当年老师临别送我的诗是郑板桥歌颂兰花的,
身在千山顶上头,突岩深缝妙香稠。非无脚下浮云闹,
谨以此文记载那段岁月,
--
※ 修改:·qianning 于 Dec 14 03:33:24 2008 修改本文·[FROM: 132.216.73.*]
※ 来源:·水木社区 http://newsmth.net·[FROM: 76.68.244.*]
Wednesday, December 10, 2008
Novell&Intel OTC workshop
去的比较早,因为我总是迷路,怕迟到。果然,Novell在36楼,我到财富中心后直接上了37楼以上的电梯,电梯关门后才发现木有36楼按钮。。。残念。。。无奈地去38楼游览了一番后回到1楼换电梯。。。再次对我的路盲特性表示无奈。。。
到了Novell,先找Coly,然后一起布置会议室。Novell的会议室可真不是盖的!第一次玩这种隔间的会议室,中间的隔墙太高级了,两间房间只要把隔墙收起来,就成了一个大的会议室。布置完,时间还早,趴桌上小睡一会儿:)
时间飞快的到了两点半左右,一阵爽朗的笑声把我从周公那里叫了回来。抬头一看,原来是Intel OTC的工程师们来了。一阵寒暄之后,Coly通知来了Novell的工程师,简单的介绍之后,会议正式开始。
因为已经是第四次讲grub4ext4了,这次讲起来有些轻车熟路的感觉。而且这次的slide是在Coly的细心指导下完成的,内容和结构都较以前的版本有了质的飞跃。从VFS讲起,到grub,再到ext2/3,再到ext4,再到grub4ext4。其间被问过好几个问题,所幸对这一块还比较熟悉,答的还算不错。其中比较遗憾的是我对sparse_super这个特性的理解有偏差。之前只是知道有这个feature,没有仔细去看它的实现。还好Coly即时发现并指正了我的错误。
讲完grub4ext4,看了看还有时间,就介绍了一下最近正在参与的让ext4文件系统在没有journal的情况下工作的patch。这个patch的思路比较简单,主要是去hack ext4中调用jbd2的一些接口函数。
workshop完了之后,Alex过来,几个人一起讨论了一下一个文件加密的思路。然后一起去BLUG聚会。地点在俄罗斯餐厅,以前听fay说过,我是第一次去。会上认识了一位Intel的kernel engineer。他很nice的帮我解决了我之前在ext4分区上安装的opensuse无法启动的问题。
总的来说,今天的活动收获最大的就是演讲的时候不那么害怕了(汗一下。。。),还有在和各位工程师的讨论中,对ext4文件系统的理解有更深了一层。晚上在俄罗斯餐厅瞎玩的时候,还无意的发现了之前Eric Sandeen提到的tune2fs -I的bug的原因,主要是因为flex_bg把inode table放到一起之后造成no room for larger inode error.
最后对长久以来对我提供了无比大的支持的Coly Li和各位Linuxer@bupt的同学和朋友们致以崇高敬意和由衷的感谢!
Wednesday, April 30, 2008
GSoC 2008申请总结
先简单介绍下,这次google summer of code我申请的是由colyli指导的 enable ext4 file system as boot partition (http://en.opensuse.org/Summer_of_Code_2008#enable_ext4_file_system_as_boot_partition),我的申请主页在 http://bergwolf.googlepages.com/grub4ext4,项目主页(待建)在 http://code.google.com/p/grub4ext4/。这么设置是因为google给了一个proposal的例子就是这样的——用一个blog存放开发过程,用公开的repository保存项目代码。
整个申请过程主要分为三个阶段:前期准备,写proposal阶段和ranking阶段。
1. 前期准备
因为上学期就打算做这个grub4ext4的项目,我在寒假期间看了一些grub legacy的代码,主要集中在stage2目录下,同时看了一些前人对grub源码的分析文档。这学期开学后我在mailling list上发过一篇总结。这篇总结也实际上成为我的proposal中grub部分的雏形,当时也不知道这个项目会申请成为SoC项目。
或许我这只是特例,因为很早就开始接触相关的东西。但是想想mentor和organization都肯定更愿意把项目交给熟悉项目背景的人,所以多参与开源项目,多接触开源社区还是有好处的^_^
2. 写proposal阶段
这阶段我最大的两个感悟是:多和mentor接触,多和一起申请的人接触。
这期间我完成proposal初稿后发给colyli看过,colyli给了很多很有价值的意见,十分感谢。这些意见和建议让我对项目的思路有了很多新的认识,这些都体现在了最后的成稿中。proposal中不能有抄袭这点也是coly告诉我的。那天我正在实验室干活,接到coly电话后赶紧修改。这可是救火啊。。。感激之心难以言寓~~~
freenode上有个gsoc的channel,这上面不仅有正在申请的学生,还有不少mentor和google工作人员,是个很好的交流的地方。我写proposal的那几天几乎成天挂在上面,即使不发言,偶尔看看别人的对话也能学到很多东西。例如有的mentor明确指出不接受proposal里面使用一些网络上常用的聊天用语(you=u之类)的人,所以写申请还是formal一些的好。
另外要注意proposal的字数限制,这点是在申请的最后一天我在IRC上问的。回答的人是google人员,所以也应该算官方的说法。proposal有7500 character的限制,这里的字数是byte而不是word,而且包括空格。千万不要超过这个限制,因为超过限制的proposal会被truncate,即最后只有前7500 byte会被打分的mentor们看到,而超出部分直接丢弃。
proposal的主要目的是说服mentor和google,让他们觉得你的项目值得做而且具有可行性。有人这么说,when you propose a project, the most important thing is how it will benefit to the community instead of how cool it is.虽然有些极端但也不无道理。至于如何说服,那就是八仙过海,各显神通的事了。
proposal一定要包含的几点:自己对项目的理解和描述(多和mentor沟通是正确理解项目需求的重要方法);提出可行的实现方案(在有初步构思后和mentor的交流由询问变为讨论,而讨论的结果往往就是可行的方案);具体的开发计划(包含重要时间点和事件,让mentor们看了之后觉得这个方案确实可行)。
我有位本科同学今年也在申请GSoC,他给了我几个他找到的前人的proposal。这些proposal也都包含了以上几个要点。在这里也要感谢这位同学对我的帮助,有空一定bg你。
3. ranking阶段
在过了application deadline之后就进入ranking in progress阶段。到了这一阶段实际上工作已经大部分做完了,就只是等待结果。不过按照google的说法,mentor还是可以在application page上提问,所以这段时间还是需要经常上去看看。
当applicatin status由ranking in progress变为reviewer assigned的时候,你的proposal就已经由某个具体的mentor(很可能就是最后带你的mentor)审阅了。这说明这个organization已经在考虑要不要把你的申请提交给google了。
当application status变为application accepted的时候,恭喜你,you are in!
说一下我的申请感受:
1. mentor是申请的关键。多和mentor交流不但有助于自己对项目的理解,也有助于mentor对你的了解。相信很少有mentor把项目交给一个交了一份proposal后就再也不出现的人。
2. 多和申请人交流。不同的人有不同的思考问题的方法,或许别人所想的就正是你欠缺的,讨论才能加深自己对项目和对自己的方案的理解。不要害怕竞争,google给每个项目计划了至少两个slot。如果你和竞争者都足够优秀,不要担心google会刷掉你们任何一个。
3. 注重细节。申请中有很多需要注意的细节,google的FAQ建议都看一遍。不要怕浪费时间,在每个细节上比别人多做一点,最后累积起来就是进步。不但申请GSoC,做人亦是如此。
最后我要感谢Colyli,他在我的申请过程中给了我莫大的帮助,万分感谢,这之后肯定还有许多需要麻烦他的地方^_^
GSoC申请成功对我而言不是一个终点而是一个起点,我面前还有一个充实且“疯狂”(coly语^_^)的夏天。我得好好prepare myself, and enjoy summer of code.
Tuesday, April 15, 2008
Macbeth: Act 1, Scene 1
Enter three WITCHES.
First Witch
When shall we three meet again?
In thunder, lightning, or in rain?
Second Witch
When the hurlyburly's done,
When the battle's lost and won.
Third Witch
That will be ere the set of sun.
First Witch
Where the place?
Second Witch
Upon the heath.
Third Witch
There to meet with Macbeth.
First Witch
I come, Graymalkin!
Second Witch
Paddock calls.
Third Witch
Anon.
ALL
Fair is foul, and foul is fair:
Hover through the fog and filthy air.