[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <532FEB03.20600@jp.fujitsu.com>
Date: Mon, 24 Mar 2014 17:21:23 +0900
From: Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
To: Preeti Murthy <preeti.lkml@...il.com>
CC: linux-kernel@...r.kernel.org,
Fernando Luis Vazquez Cao <fernando_b1@....ntt.co.jp>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Frederic Weisbecker <fweisbec@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Arjan van de Ven <arjan@...ux.intel.com>,
Oleg Nesterov <oleg@...hat.com>, preeti@...ux.vnet.ibm.com
Subject: Re: [PATCH 1/2] nohz: use seqlock to avoid race on idle time stats
(2014/03/24 16:45), Preeti Murthy wrote:
> Hi Hidetoshi,
>
> The patch looks good to me except the comments around the monotonicity
> of the return value of the idle stats observer. I am unable to relate them
> to the dependency on nr_iowait_cpu.
>
> I see that when the reader queries for the idle stats and calls
> get_cpu_idle_time_us(), the nr_iowait_cpu might be 0. When he later
> queries get_cpu_iowait_time_us(), it may be >0 . Hence we will be
> accounting for the idle time in both idle time and iowait time. This
> is definitely a problem. But I do not understand what this has got to
> do with the monotonicity of the time
> returned. This is just for my understanding.
Thank you for your comment!
Ah yes, I think I could write better comments around here to clarify
the monotonicity problem. (It will be happy if someone can give me
such better sentence for here :-D)
One important point is that readers do not update idle stats when they
use these function. i.e.
given:
idle stats: idle=1000, iowait=100
stamp at idle entry: entry=50
nr tasks waiting io: nr_iowait=1
1st reader:
query @ now=60
idle=1000
iowait=110 (=100+(60-50))
(here nr_iowait changed to 0)
2nd reader:
query @ now=70
idle=1020 (=1000+(70-50))
iowait=100
So you will see iowait is decreased from 110 to 100.
I hope this short story helps you.
Thanks,
H.Seto
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists