* [Question] sched: Is nsecs_to_cputime valid?
@ 2012-07-05 3:05 Namhyung Kim
0 siblings, 0 replies; only message in thread
From: Namhyung Kim @ 2012-07-05 3:05 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar; +Cc: Frederic Weisbecker, LKML
The following message is a courtesy copy of an article
that has been posted to gmane.linux.kernel as well.
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-05 3:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-05 3:05 [Question] sched: Is nsecs_to_cputime valid? Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox