Aug 072007
 

前几天Linus决定用CFS替换掉O(1)的时候就引发了一场flame war,然而除了几个当事人之外,其他人也仅仅能从使用体验上提出一些意见或者benchmark数据。更因为这些schedulers都没有经过长期考验,没有经验性数据,一堆各个领域的用户都七嘴八舌得参与进来,进而这场大讨论又闹到Server VS Desktop,Scientific Computing VS Gaming等等等等。谁让scheduler本身就是一个牵一发而动全身的关键组件呢,动这玩艺就相当于给人换大脑一样。

这次论战现在又有学院派的高人卷进来了,恰逢FreeBSD的ULE调度器3.0发布不久,所以ULE的作者Jeff Roberson (jeffr)也写了一篇文发表了自己的看法,见此:http://jeffr-tech.livejournal.com/12933.html

 jeffr的文章是从设计角度来讨论了这三个调度器实现的不同点,基本上也就是使用的数据结构和算法不同带来的性能影响,有兴趣可以仔细看看,比起LKM那些论战来,不需要懂得那几个大牛之间的前恩宿怨,应该要好看一些。

另外看看用户而不是开发者的comments也是挺好玩的:http://osnews.com/comment.php?news_id=18401

不过毕竟是看过代码才有发言权,普通用户的言论看过就好,没必要较真,真要了解细节还只能看代码。话说回来看完代码估计也不一定就了解。Scheduler设计真是每个变量都要考虑到毫厘,象我这种仅仅是结合几部书讲解调度器的章节过了一遍O(1)和初代ULE的人,还是不理解为什么这样设计或为什么不那样做。所以还是继续看大牛们的热闹吧。

  18 Responses to “A comment abount SD, CFS Schedulers,from ULE’s author”

  1. 又是要跳墙看的文章,哈哈

    最恶心的是linus没认清形势
    偶觉得要是核心能帮着ubuntu等热门发行版提高占有率,才有可能翻翻身嘛…

    ps: freebsd好使吗? 以前用印象还不错.好久没用过freebsd了…
    不过相信问题比现在偶用的64bit linux还多.

  2. 另外,再加一个,2.6.23-rc2-mm1啥时候来啊,偶的 / 可是reiser4…

  3. 那些kernel hacker们只管自顾自得推陈出新,哪管你发行版死活,话说小版本号跳一跳就出现API变化的先例又不是没有。倒是各大发行版的成功反过来为Linux本身留住了很大一批用户。例如RH,例如Debian,例如Ubuntu。后者还好,发行周期比较快能几乎跟得上kernel更新,RH可就是整天backport来玩了。
    关于FreeBSD,个人认为Release-7将会是一个非常棒的版本,因为经历了5和6的大规模变化,FreeBSD在7上已经能够实现非常健壮的SMP性能,协议栈也因为SMPng有不小的改进,FS方面借助ZFS也是几乎现在无人能匹敌。可以说是经由前面几个版本的耕耘,7应该是一个开始收获的版本,至少在服务器应用方面,已经能比肩甚至超越目前的2.6kernel。至于Desktop嘛,估计还要加把力。
    用reiser作root,别最后搞得像reiser一样精神出问题,太危险了吧。

  4. /home是reiserfs,应该算稳定,这个不用换.
    丢 / 不可怕,有定期的 tar 备份,
    用parted magic livecd恢复… :D

    reiser4就和偶文章中所说的一样,cryptcompress是开的.
    从打开电源到输完密码进到xfce4不到35s,神奇吧…
    (如果偶有钱买上SSD,25s以内应该没问题.)

    2.6.23-rc1-mm2带的reiser4 TMD是坏的…

  5. 貌似rc2出来了,你可以去踩地雷了:)

  6. 你都不仔细看,偶要rc2-mm1 :)
    踩雷也要对应版本

    研究研究这个神奇的图?
    http://people.freebsd.org/~jeff/sysbench.png

    ps: 谁有8核服务器?

    ps2: 看你用的是Google Apps,
    上面有googletalk不?如有发邮件说明一下什么时候出没.

  7. 从来没追过-mm,忽略了,sorry。
    这幅图应该是稍稍有点过时了,这幅图的测试的时候使用的调度器应该是CFS还没进入mainline的时候,不过性能应该基本定下来了。还要注意的是这幅图上的ULE为ULE 2.0。而那个SCHED_SMP则是ULE 2.0针对SMP做进一步优化的一个fork,而这个SCHED_SMP在上个月正式合并回ULE后催生了ULE 3.0。记得jeff大牛后来还放过一个ULE3.0的测试图来的,那个折线还能再高挑一点,但这个新图没有对CFS的对比,不幸的是我忘记看过的哪篇文章贴过这图了。
    现在单CPU的8核服务器还不好找,不过双路4核的就很普遍了,很多类似的测试都是在双路4核服务器跑下来的。
    google talk从来没玩过,有机会的话玩玩看。

  8. 1 mm对偶的唯一作用是提取patch,偶才不会全打上. :D
    2 当然是双路
    3 实际上更想试试tcmalloc+CFS会是什么效果
    总觉得CFS在给glibc补缺陷一样.虽然好像不应该这么说
    tcmalloc才是一个真正意义上给glibc在线程方面加力的东西.从图上可以看出来的.
    (另外freebsd以前在mysql上表现不佳是什么原因?)

    当然,如果能给SD一个跑跑的机会也不错(不过不测也罢,SD主要对桌面)
    4 不用gtalk可以用别的嘛…
    psi,gajim,gaim(pidgin),加上google官方的方法,都能上.看了.
    输你现在的mail就可以.

  9. 恩,按道理说确实本应该是glibc的malloc实现的问题,但加了CFS反倒好像能规避掉这个问题似的.不过CFS的曲线也十分不正常,不是整体性能高低,关键是2-4-6-8之间的折线斜率变化很不正常.
    关于freebsd下mysql性能差,里面的故事还挺曲折的,大体是FreeBSD5之前的版本用户级线程库几乎不怎么可用,导致mysql性能极端低下,而5这个版本开始采用了KSE作为线程调度单位,实现了复杂的M:N模型,理论上性能应该会很好,但由于mysql设计本身根本没考虑到M:N的问题,很不幸得继续低下。再之后FreeBSD6发布后的一段时间,又出现了1:1的libthr,用了这玩艺之后,FreeBSD的mysql性能终于可以跟Linux相提并论了,再加上ULE助力,这才在SMP下跑mysql得以扬眉吐气。

  10. 报告一下战况…

    从mm2里面抽的reiser4不错,能编译… :D

    未经严格检测

    另外踩一踩CFS的地雷…
    感觉 SD 好像真有一点点问题一样.

  11. 撞雷了… :D :D

    2.6.22
    grep “generic_sy” include/linux/fs.h
    extern void generic_sync_sb_inodes(struct super_block *, struct writeback_control *);

    2.6.23

    extern int generic_sync_sb_inodes(struct super_block *, struct writeback_control *);

  12. 继续牢骚:

    哪个大牛不顺眼把这个给改了!….

  13. http://www.networkmirror.com/1FDFr2fg9hle84Mz/www.efytimes.com/efytimes/21160/news.htm

    Q: Why do you think CFS is better than SD?

    Linus: Part of it is that I have worked with Ingo [Molnar] for a long time, which means that I know him, and know that he’ll be very responsive to any issues that come up. That kind of thing is very important.

    But part of it is simply about numbers. Most people out there actually say that CFS is better than SD. Including, very much, on 3D games (which people claimed was a strong point of SD).

    At the same time, though, I don’t think any piece of code is ever ”perfect”. The best thing to happen is that the people who want to be proponents of SD will try to improve that so much that the balance tips over the other way — and we’ll keep both camps trying interesting things because the internal competition motivates them.

  14. Q: I’m very curious about what the future holds for file systems in the kernel. What do you think about Reiser4, XFS4, ZFS and the new project founded by Oracle? ZFS has been receiving a lot of press these days. Reiser4 delivers very good benchmarks, and xfs4 is trying to keep up, whereas the one by Oracle has a lot of the same specs as Sun’s ZFS. Where are we heading? Which FS looks the most promising in your opinion? — Ayvind Binde.

    Linus: Actually, just yesterday we had a git performance issue, where ZFS was orders of magnitude slower than UFS for one user (not under Linux, but git is gaining a lot of traction even outside of kernel development). So I think a lot of the ‘new file system’ mania is partly fed by knowing about the issues with old filesystems, and then the (somewhat unrealistic) expectation that a ‘new and improved’ filesystem will make everything perfect.

    In the end, this is one area where you just let people fight it out. See who comes out the winner — and it doesn’t need to be (and likely will not) be a single winner. Almost always, the right choice of file system ends up depending on the load and circumstances.

    One thing that I’m personally more excited about than any of the filesystems you mention is actually the fact that Flash-based hard disks are quickly becoming available even for ‘normal’ users. Sure, they’re still expensive (and fairly small), but Flash-based storage has such a different performance profile from rotating media, that I suspect that it will end up having a large impact on filesystem design. Right now, most filesystems tend to be designed with the latencies of rotating media in mind.

  15. Nice Site! Thanks!

  16. Thankfulness to my father who shared with me about this
    blog, this website is genuinely amazing.

  17. It provides an excellent customer support as ideally.

    These drivers offered by manufacturers are free of charge and usually solve your complaint.
    It iis somewhat a medium for a certain device efficient.

  18. If you would like to improve your know-how only keep visiting this web site and be updated with the
    newest news update posted here.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>