lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 12 Dec 2011 11:17:06 +0100
From:	Andreas Schwab <schwab@...ux-m68k.org>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	linux-kernel@...r.kernel.org, Michal Hocko <mhocko@...e.cz>,
	"Artem S. Tashkinov" <t.artem@...lcity.com>,
	Dave Jones <davej@...hat.com>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] procfs: do not confuse jiffies with cputime64_t

Arnd Bergmann <arnd@...db.de> writes:

> 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.

There is no definition of nsecs_to_cputime64 on ia64/powerpc64 with
CONFIG_VIRT_CPU_ACCOUNTING yet, probably because
CONFIG_IRQ_TIME_ACCOUNTING is x86-only.

Andreas.

-- 
Andreas Schwab, schwab@...ux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
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