What is I/O wait?

295 篇文章 0 订阅

我个人遇到过一次uninterruptable sleep (D state)的进程,当时很疑惑,当时也没有深究。现在终于在access.redhat.com上搜到了解释。

https://access.redhat.com/articles/2041

What is I/O wait?

Updated 2012年九月16日10:04 - 

English 

To understand I/O wait, one must first understand about process states. At any given moment, a process is in one of several states. This state is indicated by the STAT column in ps or top. From the ps(1) man page:

  • D - Uninterruptible sleep (usually IO)

  • R - Running or runnable (on run queue)

  • S - Interruptible sleep (waiting for an event to complete)

  • T - Stopped, either by a job control signal or because it is being traced

  • W - Paging (not valid since the 2.6.xx kernel)

  • X - Dead (should never be seen)

  • Z - Defunct ("zombie") process, terminated but not reaped by its parent

I/O wait comes solely from processes in uninterruptable sleep (D state). Generally, a process is put into D state when waiting for some sort of I/O to complete. The process has made a call into the kernel and is waiting for the result. During this period, it is unable to be interrupted, as doing so might jeopardize the state of the driver and hardware.

上一段加入baidu翻译:

I/O等待仅来自处于不间断睡眠(D状态)的进程。通常,当等待某种I/O完成时,进程将进入D状态。进程已调用内核,正在等待结果。在此期间,它无法被中断,因为这样做可能会危及驱动程序和硬件的状态。

When a process goes into D state, the kernel knows on which CPU the process was last running and will attribute the time that the process spends in D state to I/O wait on that CPU.

It is important to note that from a CPU standpoint, I/O wait is equivalent to idle time. A process in I/O wait will not block a process that is ready to run (R state).

It is also important to note that high I/O wait percentages are not necessarily a problem. On a machine that is running primarily I/O bound applications, high I/O wait percentages are often to be expected. This is simply a reflection of how the machine is spending its time (mostly just waiting for I/O to complete).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值