2011/05/21

Xen狀態running/blocked跳動問題

問題:在使用xen建立好一個domain-U後,使用virsh list (或xm list)指令觀察其狀態,可以發現domain-U的狀態常常在running/blocked切換。有些人可能誤以為這是底層xen的bug,但是這是正常現象。

我們可以從man看到xen定義了6個狀態(r - running 、b - blocked 、p - paused 、s - shutdown 、c - crashed 、d - dying),其中的

r - running:

The domain is currently running on a CPU

b - blocked:

The domain is blocked, and not running or runnable. This can be caused because the domain is waiting on IO (a traditional wait state) or has gone to sleep because there was nothing else for it to do.

也就是說running是系統有在執行工作,而blocked則是沒有工作可以做。我做了一個試驗,使用vnc登入domain-U,執行一個無限回圈的程式,在透過觀察後確認那台domain-U會一值處於running狀態。所以blocked和running頻繁的跳動是正常現象,這是因為OS本身的背景服務被執行時就會處於running狀態,隨後又處於blocked狀態。

沒有留言:

Buddhism and Software Developer

In today's fast-paced society, we are often surrounded by work, goals, and external pressures. However, the wisdom found in Buddhism off...