yu's profile表说偶无趣:)PhotosBlogLists Tools Help
    January 24

    CLF很久不见的创意 :)

    (1) 一个kernel thread:wifed已经完全占有系统所有的资源,所有其他process比如以前运行多年的smoked, drinkd等统统被杀死,很多时候连process 0: idle都不允许运行。系统的所有的运行情况都受到这个超级task的监控。

    该kernel thread在某种情况下还会fork出1个以上child process: childd。这种child process更是要命,甚至wifed都要没有机会运行。wifed有时候还会nice一下,给IDLE process一点喘息余地。可是childd根本一点道理都不讲。

    wifed基本上希望独占系统,任何情况的context switch基本上被wifed检测到。这种情况下欲switch的task都被kill,而且不可屏蔽。即使侥幸躲过检测或者发生异常的情况下 (exception),完成了context switch,当wifed重新占有cpu时发现系统中竟然有非wifed, childd以外的loverd,这种情况下wifed会拼命去kill loverd。如果能够成功kill, 系统经过一次大的颠簸以后还可以运行下去;如果不能成功kill, 系统就会崩溃。反正随便context switch, 很可能会使系统进入不可知状态。
     
    (2)此种不稳定情况有个专门的技术名词叫OOM(out of marriage)。在系统设计的时候,也有个糟糕的解决办法叫做OOM-killer:选出一个task然后放弃。可是对于系统中的各种task,每个 architect都有不同的取舍原则。这样就产生了各种算法。

    做个简单的分析:现在系统中有三个task: wifed, childd和loverd。其中wifed和childd因为是parent-child关系,所以一荣俱荣,一损俱损。所有只有两种策略,要么保留 wifed进程组,要么保留loverd。哪种选择都是痛苦的。
     
    January 16

    Some Linux Cookies

    一些有趣的linus的发言,anyway,我ZT目的不是觉得他是个完美的人,不过他应该算个有趣的程序员,而且代码写的哈不错.

     

    Dijkstra probably hates me
    (Linus Torvalds, in kernel/sched.c)-----读一下code,计算一下goto使用数量:)

    "How should I know if it works?  That's what beta testers are for.  I only coded it."
    (Attributed to Linus Torvalds, somewhere in a posting)

    "I'm an idiot.. At least this one [bug] took about 5 minutes to find.."
    (Linus Torvalds in response to a bug report.)

    "If you want to travel around the world and be invited to speak at a lot of different places, just write a Unix operating system."
    (By Linus Torvalds)

    > > Other than the fact Linux has a cool name, could someone explain why I
    > > should use Linux over BSD?

    > No.  That's it.  The cool name, that is.  We worked very hard on
    > creating a name that would appeal to the majority of people, and it
    > certainly paid off: thousands of people are using linux just to be able
    > to say "OS/2? Hah.  I've got Linux. What a cool name".  386BSD made the
    > mistake of putting a lot of numbers and weird abbreviations into the
    > name, and is scaring away a lot of people just because it sounds too
    > technical.
    (Linus Torvalds' follow-up to a question about Linux)

    > The day people think linux would be better served by somebody else (FSF
    > being the natural alternative), I'll "abdicate".  I don't think that
    > it's something people have to worry about right now - I don't see it
    > happening in the near future. I enjoy doing linux, even though it does
    > mean some work, and I haven't gotten any complaints (some almost timid
    > reminders about a patch I have forgotten or ignored, but nothing
    > negative so far).

    > Don't take the above to mean that I'll stop the day somebody complains:
    > I'm thick-skinned (Lasu, who is reading this over my shoulder commented
    > that "thickheaded is closer to the truth") enough to take some abuse.
    > If I weren't, I'd have stopped developing linux the day ast ridiculed me
    > on c.o.minix.  What I mean is just that while linux has been my baby so
    > far, I don't want to stand in the way if people want to make something
    > better of it (*).
    Linus

    `When you say "I wrote a program that crashed Windows", people just stare at
    you blankly and say "Hey, I got those with the system, *for free*".'
    (By Linus Torvalds)