2005年3月11日 星期五

Spork::TKSlide


Spork::TKSlide 好像壞一陣子,我這兩天把他修好了,只為了下禮拜要報告 paper orz。
剩下的問題是 Spork 本身的 bug Q_Q





寫了封信直接找 Ingy,希望能得到正面的回應 :)

2005年3月8日 星期二

slab in Linux kernel


之前看了 <<Linux Kernel Development>> 中談到 Memory Management 那章。今天剛好在 irc 上聊到,這是一點點對 slab 的介紹 :P




22:31  slab 算是 kernel 裡面 kmalloc 的一個 "page (概念上)"
22:32 kernel 裡面會對各種不同的 slab 作 cache 之類的
22:33 slabtop(1) 可以看不同 slab 中的最大值 (對各個欄位)

22:36 slab 的 cache 是這樣的,因為去拿一個新的 slab 的 cost 比較高,
所以每當有 slab 被 free 掉時,會存起來當 cache
22:37 100% usage 可能是目前站上比較 active :Q
22:38 slab 應該沒有什麼夠不夠的

2005年3月6日 星期日

2005/03/05 李瑞麟紀念賽


第一次去棒球場看比賽,我覺得是場很輕鬆的比賽。





11:4





這樣下來,總算是對李老師,球員們都有個交待了吧。
唯一的遺憾是褚志遠出車禍沒辦法來 >



啦啦,想把這種感覺留在心裡面品嘗 :)





---





比賽前要到了曾貴章跟陳慶國的簽名,可惜廖敏雄的時間不夠沒排到 :(

2005年3月2日 星期三

cpanplus's dependency.deb


我把 cpanplus depend 的 perl packages 全包成 deb 了。如果想裝這些 cpanplus 跟這些 packages,可以在 /etc/apt/sources.list 中加入




deb http://victor.csie.org/debian/ unstable cpanplus


並安裝 libcpanplus-perl-snapshot :)





順便讀了 Debian Policy Manual 中關於 Conflics, Provieds, Replaces 的部分 :)

2005年2月20日 星期日

[lang_zh]CPU 的 iowait (top(1) 的 wa)[/lang_zh][lang_en]CPU's iowait (wa in top(1))[/lang_en]

[lang_zh]
ptt 的 CPU 在 iowait 的部分吃了非常多的 cpu time (30% 以上),我們覺得 iowait
應該是指 disk I/O, memory I/O 的部分。但是在有 DMA 的前提下,為什麼 CPU 能在
這個部分吃這麼多 cpu?

Trace 進 kernel 看的結果,這個時間在 io_schedule() 時會加上去:
[/lang_zh]

[lang_en]
Ptt's CPU is eaten a lot in the part of iowait, we thought iowait means disk I/O. But with DMA, why CPU takes such a lot of CPU time?

Trace into the kernel, I found the time of iowait will be added inside io_schedule():
[/lang_en]


void __sched io_schedule(void)
{
struct runqueue *rq = &per_cpu(runqueues, _smp_processor_id());

atomic_inc(&rq->nr_iowait);
schedule();
atomic_dec(&rq->nr_iowait);
}



[lang_zh]
中間 context switch 出去之後,每次 timer interrupt 來時,會計一次時間。其中 system time 的部分,如果 nr_iowait 是 true 的話,iowait 就會加上去。於是這個 iowait 就不只是等待 I/O 的時間了。Process 數量少時當然可以忽略,但是在 ptt 上 25000 隻 process ...
[/lang_zh]

[lang_en]
During the context switch from the middle, each time interrupt increase the value if nr_iowait is true. So iowait is no longer the waiting time of I/O. Of course it can be omitted if the process number is small, but ptt has more than 25000 process ...
[/lang_en]

2005年2月19日 星期六

有趣的一些 perl module


原來惡搞的 perl module 那麼多 orz,Acme 裡面好像都是惡搞的耶 XD 隨便來幾個




Acme::BadExample


use Acme::BadExample;


然後就 compile 不過了 orz






Acme::Bleach


#!/usr/bin/perl
use Acme::Bleach
print "blah";


然後執行這個檔之後,這個檔就只剩 use Acme::Bleach 了 orz!
所有 printable character 都會被變成 tab/space。 讓我想到王尹的泡沫化程式 ^^;






Acme::Debug




use 之後 如果開 debugger mode,會把程式碼裡面含 b, u, g 的 subsequence 找出來 O_o






Acme::ComeFrom




goto 的逆向操作 autrijus 的作品,不太直覺就是了 ^^;





不過也有另一些不同的有趣的 ^^;
像是 use Acme::Intraweb; 之後如果 use use SomeModule; 但是 @INC 找不到的話,
他就直接上網抓下來 O_O





Have fun! :D

2005年2月16日 星期三

ext3 sucks!!

[lang_zh]
過年前大家都回家了,剛好在這個時候宿舍斷電。我 BIOS 有設好,所以之前斷電後都會自動重開。但是這次卻沒起來,停了大概有 10 天吧 @@; 回來後發現是 ext3 爛掉了。真是太差了,一般非 journal fs 開機後可以先自動 fsck 再開進去,但這次我的 ext3 竟然在 loader 就 load 不進來 kernel -_- 我決定以後 root 也不用 ext3 了。
[/lang_zh]

[lang_en]
Everybody went home during the Chinese New Year. Gosh, the power of the dorm went off line during this time. My BIOS was set properly, so everything went very well before. But it didn't this time. My computer was halt for about 10 days @@; After coming back, I found it caused by corrupt ext3. It sucks, non-journal fs can fsck after the booting at least, but my ext3 dead in the loader -_- I won't use ext3 anymore.
[/lang_en]