lkml.org 
[lkml]   [2011]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] procfs: do not confuse jiffies with cputime64_t
Date
On Monday 12 December 2011, Andreas Schwab wrote:
> @@ -46,7 +46,7 @@ static cputime64_t get_iowait_time(int cpu)
> /* !NO_HZ so we can rely on cpustat.iowait */
> iowait = kstat_cpu(cpu).cpustat.iowait;
> else
> - iowait = nsecs_to_jiffies64(1000 * iowait_time);
> + iowait = jiffies64_to_cputime64(nsecs_to_jiffies64(1000 * iowait_time));
>
> return iowait;

Hmm, shouldn't this be using nsecs_to_cputime64()? For some reason however, that function
is (incorrectly?) defined as

include/asm-generic/cputime.h:#define nsecs_to_cputime64(__ct) nsecs_to_jiffies64(__ct)

and only used in one place, in

kernel/sched.c: if (cputime64_gt(nsecs_to_cputime64(latest_ns), cpustat->irq))
kernel/sched.c: if (cputime64_gt(nsecs_to_cputime64(latest_ns), cpustat->softirq))

I'm not sure what the correct solution is, but I would assume that ia64 and powerpc
should fix their definitions of nsecs_to_cputime64() anyway.

Arnd


\
 
 \ /
  Last update: 2011-12-12 10:25    [W:0.082 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site