lkml.org 
[lkml]   [2007]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] sched: make cpu_clock() not use the rq clock
From
Date
On Thu, 2007-26-07 at 11:00 +0200, Ingo Molnar wrote:
> Subject: sched: make cpu_clock() not use the rq clock
> From: Ingo Molnar <mingo@elte.hu>
>
> it is enough to disable interrupts to get the precise rq-clock
> of the local CPU.

Hi Ingo,

Those new fast nanoseconds resolution clock APIs are nice but it seems
to me that their naming and _where_ they are implemented in the tree is
a little odd, IMO.

We have:

1. sched_clock() is in kernel/sched.c (weak implementation)
2. sched_clock() is in arch/i386/kernel/tsc.c (architecture override)
3. rq_clock() is in kernel/sched.c
4. cpu_clock() is in kernel/sched.c

I would suggest:

1. rename sched_clock() (remove sched_ as it's not sched specific
anymore) and place it in kernel/time/...
2. rename the architecture specific version of it too

This first function is the basic fast ns clock

3. base your rq_clock() on cpu_clock() (#4) or use the later directly.

This is local to sched.c

4. move cpu_clock() in kernel/time/...

This the per-cpu monotonic version.


See my point? Base the scheduler clock from a general kernel API, not
the other way around.

Just a suggestion.


Best regards,

- Eric


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-27 04:59    [W:0.317 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site