linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* about definition of iowait
@ 2016-06-07 11:24 Cao jin
  2016-06-07 12:01 ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: Cao jin @ 2016-06-07 11:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, Izumi, Taku/泉 拓

Hi,

I noticed some problems about iowait entry of /proc/stat: it seems not 
accurate, and sometimes will decrease in SMP.

For UP, we have a simple definition about iowait, which is:
The time that the processor is idle, during which there is a task 
waiting for I/O.

This definition seems don't fit well when step into SMP era, so I think 
maybe it can be extended like:
For a given CPU, the I/O wait time is the time during which that CPU was 
idle, and there is at least one outstanding disk I/O operation requested 
by a task scheduled on that CPU.

But tasks can migrate among cpus, so this definition maybe not accurate.

I also saw some suggestions that it should be a global value, not per 
cpu, but don`t see clear definition, so anyone have suggestions about 
it? (personally guessing, maybe: there is task waiting for outstanding 
I/O while all cpus are idle? But I don't think it is good...)

-- 
Yours Sincerely,

Cao jin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: about definition of iowait
  2016-06-07 11:24 about definition of iowait Cao jin
@ 2016-06-07 12:01 ` Peter Zijlstra
  2016-06-08  7:14   ` Cao jin
  2016-06-27  6:06   ` Cao jin
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Zijlstra @ 2016-06-07 12:01 UTC (permalink / raw)
  To: Cao jin; +Cc: linux-kernel, Izumi, Taku/泉 拓

On Tue, Jun 07, 2016 at 07:24:46PM +0800, Cao jin wrote:
> Hi,
> 
> I noticed some problems about iowait entry of /proc/stat: it seems not
> accurate, and sometimes will decrease in SMP.
> 
> For UP, we have a simple definition about iowait, which is:
> The time that the processor is idle, during which there is a task waiting
> for I/O.
> 
> This definition seems don't fit well when step into SMP era, so I think
> maybe it can be extended like:
> For a given CPU, the I/O wait time is the time during which that CPU was
> idle, and there is at least one outstanding disk I/O operation requested by
> a task scheduled on that CPU.
> 
> But tasks can migrate among cpus, so this definition maybe not accurate.
> 
> I also saw some suggestions that it should be a global value, not per cpu,
> but don`t see clear definition, so anyone have suggestions about it?
> (personally guessing, maybe: there is task waiting for outstanding I/O while
> all cpus are idle? But I don't think it is good...)

It is possible to come up with definition for a single global number;
per-cpu iowait numbers are doomed.

But I don't see it matters one way or the other. Personally I would just
make the kernel return 0 and be done with it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: about definition of iowait
  2016-06-07 12:01 ` Peter Zijlstra
@ 2016-06-08  7:14   ` Cao jin
  2016-06-27  6:06   ` Cao jin
  1 sibling, 0 replies; 4+ messages in thread
From: Cao jin @ 2016-06-08  7:14 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: linux-kernel, Izumi, Taku/泉 拓



On 06/07/2016 08:01 PM, Peter Zijlstra wrote:
> On Tue, Jun 07, 2016 at 07:24:46PM +0800, Cao jin wrote:
>> Hi,
>>
>> I noticed some problems about iowait entry of /proc/stat: it seems not
>> accurate, and sometimes will decrease in SMP.
>>
>> For UP, we have a simple definition about iowait, which is:
>> The time that the processor is idle, during which there is a task waiting
>> for I/O.
>>
>> This definition seems don't fit well when step into SMP era, so I think
>> maybe it can be extended like:
>> For a given CPU, the I/O wait time is the time during which that CPU was
>> idle, and there is at least one outstanding disk I/O operation requested by
>> a task scheduled on that CPU.
>>
>> But tasks can migrate among cpus, so this definition maybe not accurate.
>>
>> I also saw some suggestions that it should be a global value, not per cpu,
>> but don`t see clear definition, so anyone have suggestions about it?
>> (personally guessing, maybe: there is task waiting for outstanding I/O while
>> all cpus are idle? But I don't think it is good...)
>
> It is possible to come up with definition for a single global number;
> per-cpu iowait numbers are doomed.
>
> But I don't see it matters one way or the other. Personally I would just
> make the kernel return 0 and be done with it.
>

I see. Thanks peter

-- 
Yours Sincerely,

Cao jin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: about definition of iowait
  2016-06-07 12:01 ` Peter Zijlstra
  2016-06-08  7:14   ` Cao jin
@ 2016-06-27  6:06   ` Cao jin
  1 sibling, 0 replies; 4+ messages in thread
From: Cao jin @ 2016-06-27  6:06 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: linux-kernel, Izumi, Taku/泉 拓

Hi Peter
     Sorry to bother you on this topic again.

On 06/07/2016 08:01 PM, Peter Zijlstra wrote:
> On Tue, Jun 07, 2016 at 07:24:46PM +0800, Cao jin wrote:
>> Hi,
>>
>> I noticed some problems about iowait entry of /proc/stat: it seems not
>> accurate, and sometimes will decrease in SMP.
>>
>> For UP, we have a simple definition about iowait, which is:
>> The time that the processor is idle, during which there is a task waiting
>> for I/O.
>>
>> This definition seems don't fit well when step into SMP era, so I think
>> maybe it can be extended like:
>> For a given CPU, the I/O wait time is the time during which that CPU was
>> idle, and there is at least one outstanding disk I/O operation requested by
>> a task scheduled on that CPU.
>>
>> But tasks can migrate among cpus, so this definition maybe not accurate.
>>
>> I also saw some suggestions that it should be a global value, not per cpu,
>> but don`t see clear definition, so anyone have suggestions about it?
>> (personally guessing, maybe: there is task waiting for outstanding I/O while
>> all cpus are idle? But I don't think it is good...)
>
> It is possible to come up with definition for a single global number;
> per-cpu iowait numbers are doomed.
>
> But I don't see it matters one way or the other. Personally I would just
> make the kernel return 0 and be done with it.
>

So I just want to make sure, is it acceptable if I send a patch make 
iowait a constant 0? Because make it zero seems we are abandoning it(0 
doesn'`t have any meanings for it). While maybe some user space tools 
monitors this value.

-- 
Yours Sincerely,

Cao jin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-27  6:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07 11:24 about definition of iowait Cao jin
2016-06-07 12:01 ` Peter Zijlstra
2016-06-08  7:14   ` Cao jin
2016-06-27  6:06   ` Cao jin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).