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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <87txxmlxgi.fsf@sejong.aot.lge.com>
Date:	Thu, 05 Jul 2012 12:05:01 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	linux-kernel@...r.kernel.org
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: [Question] sched: Is nsecs_to_cputime valid?

Hi,

When I look at kernel/sched/core.c, I found a dubious bit on the 
nsecs_to_cputime macro. It's defined as:

#ifndef nsecs_to_cputime
# define nsecs_to_cputime(__nsecs)	nsecs_to_jiffies(__nsecs)
#endif

While default implementation of jiffies_to_cputime (in
include/asm-generic/cputime.h) returns just the same vaule (w/
casting), some arch's (ia64, ppc and s390) define their own ones.
So nsecs_to_cputime on those arch's will end up returning time in
jiffies rather than cputime.

I see it depends on CONFIG_VIRT_CPU_ACCOUTING and ia64 and ppc use
the default j_to_ct when not defined. But it seems it's not obvious for
s390. Anyway I think converting the return value to cputime again is
need for self-containedness.

Am I missing something?

Thanks,
Namhyung

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ