<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Right. I found the following code snippet:<br><br>3715 /*<br>3716 * This task is about to go to sleep on IO. Increment rq->nr_iowait so<br>3717 * that process accounting knows that this is a task in IO wait state.<br>3718 */<br>3719 void __sched io_schedule(void)<br>3720 {<br>3721 struct rq *rq = raw_rq();<br>3722 <br>3723 delayacct_blkio_start();<br>3724 atomic_inc(&rq->nr_iowait);<br>3725 blk_flush_plug(current);<br>3726 current->in_iowait = 1;<br>3727 schedule();<br>3728 current->in_iowait = 0;<br>3729 atomic_dec(&rq->nr_iowait);<br>3730 delayacct_blkio_end();<br>3731 }<br>3732 EXPORT_SYMBOL(io_schedule);<br></div><br><br><div>--<br><div>Regards,<br>shhuiw<br></div></div><div id="divNeteaseMailCard"></div><br><pre><br>At 2014-07-15 10:28:57, "Mohammad Merajul Islam Molla" <meraj.enigma@gmail.com> wrote:
>Number of processes waiting for I/O to complete on a cpu?
>
>On Tue, Jul 15, 2014 at 8:22 AM, Andev <debiandev@gmail.com> wrote:
>> On Mon, Jul 14, 2014 at 10:21 PM, Mohammad Merajul Islam Molla
>> <meraj.enigma@gmail.com> wrote:
>>> Hi Andev,
>>>
>>> Thanks for reply. I got the definition too. What I really want to know
>>> is what this variable nr_iowait stands for?
>>> Is it counting pending input/output on a cpu?
>>>
>>>
>>> --
>>> - Meraj
>>>
>>>
>>>
>>> On Tue, Jul 15, 2014 at 8:07 AM, Andev <debiandev@gmail.com> wrote:
>>>> On Mon, Jul 14, 2014 at 10:10 AM, Mohammad Merajul Islam Molla
>>>> <meraj.enigma@gmail.com> wrote:
>>>>> Hello,
>>>>>
>>>>> I was looking into the code of cpuidle menu governor and it uses a
>>>>> function nr_iowait_cpu(int cpu).
>>>>> I could not find out what this function does.
>>>>>
>>>>> Can someone please explain what nr_iowait_cpu(int cpu) and variant
>>>>> nr_iowait() do?
>>>>>
>>>>> --
>>
>> Now that is a better question. Try looking up what nr_iowait is.
>>
>>>>
>>>> In all its glory:
>>>>
>>>> unsigned long nr_iowait_cpu(int cpu)
>>>> {
>>>> struct rq *this = cpu_rq(cpu);
>>>> return atomic_read(&this->nr_iowait);
>>>> }
>>>>
>>>>
>>>>> Thanks,
>>>>> -Meraj
>>>>>
>>>>> _______________________________________________
>>>>> Kernelnewbies mailing list
>>>>> Kernelnewbies@kernelnewbies.org
>>>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>>
>>>>
>>>>
>>>> --
>>>> Andev
>>
>>
>>
>> --
>> Andev
>
>_______________________________________________
>Kernelnewbies mailing list
>Kernelnewbies@kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
</pre></div>