Re: [PATCH 4/5] sched: Refactor iowait accounting

2013-11-04 Thread Andreas Mohr
On Mon, Nov 04, 2013 at 06:34:23PM +0100, Frederic Weisbecker wrote: > On Sun, Oct 20, 2013 at 01:10:06PM +0200, Andreas Mohr wrote: > > In case of high update traffic of parts guarded by rq->iowait_lock > > (is that a relevant case?), > > > > it might be useful to merely grab all relevant values i

Re: [PATCH 4/5] sched: Refactor iowait accounting

2013-11-04 Thread Frederic Weisbecker
On Sun, Oct 20, 2013 at 01:10:06PM +0200, Andreas Mohr wrote: > Hi, > > > +u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time) > +{ > + ktime_t iowait, delta = { .tv64 = 0 }; > + struct rq *rq = cpu_rq(cpu); > + ktime_t now = ktime_get(); > + unsigned int seq; > + > + d

Re: [PATCH 4/5] sched: Refactor iowait accounting

2013-10-20 Thread Andreas Mohr
Hi, +u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time) +{ + ktime_t iowait, delta = { .tv64 = 0 }; + struct rq *rq = cpu_rq(cpu); + ktime_t now = ktime_get(); + unsigned int seq; + + do { + seq = read_seqbegin(&rq->iowait_lock); +

Re: [PATCH 4/5] sched: Refactor iowait accounting

2013-10-19 Thread Frederic Weisbecker
On Sat, Oct 19, 2013 at 06:05:17PM +0200, Peter Zijlstra wrote: > On Sat, Oct 19, 2013 at 06:02:37PM +0200, Frederic Weisbecker wrote: > > > I just had a look at delayacct; wth wrote that crap; that too uses > > > gtod. > > > > I can't find where it does that. kernel/delayacct.c doesn't seem to at

Re: [PATCH 4/5] sched: Refactor iowait accounting

2013-10-19 Thread Peter Zijlstra
On Sat, Oct 19, 2013 at 06:02:37PM +0200, Frederic Weisbecker wrote: > > I just had a look at delayacct; wth wrote that crap; that too uses > > gtod. > > I can't find where it does that. kernel/delayacct.c doesn't seem to at least. Look for do_posix_clock_monotonic_gettime() ;-) -- To unsubscribe

Re: [PATCH 4/5] sched: Refactor iowait accounting

2013-10-19 Thread Frederic Weisbecker
On Sat, Oct 19, 2013 at 05:35:35PM +0200, Peter Zijlstra wrote: > On Sat, Oct 19, 2013 at 05:17:20PM +0200, Frederic Weisbecker wrote: > > +u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time) > > +{ > > + ktime_t iowait, delta = { .tv64 = 0 }; > > + struct rq *rq = cpu_rq(cpu); > > + k

Re: [PATCH 4/5] sched: Refactor iowait accounting

2013-10-19 Thread Peter Zijlstra
On Sat, Oct 19, 2013 at 05:17:20PM +0200, Frederic Weisbecker wrote: > +u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time) > +{ > + ktime_t iowait, delta = { .tv64 = 0 }; > + struct rq *rq = cpu_rq(cpu); > + ktime_t now = ktime_get(); > + unsigned int seq; > + > + do { >

[PATCH 4/5] sched: Refactor iowait accounting

2013-10-19 Thread Frederic Weisbecker
The iowait time accounting has awkward semantics. It is performed per CPU. The iowait time of a CPU starts when a task sleeps on IO on this CPU and stops when that task later wakes up on any CPU. This assumes that a sleeping task is still assigned to the CPU it was running on last until it wakes u