patches for current -mm kernels

Andrew Morton akpm at osdl.org
Sun Aug 3 07:22:57 EST 2003


Ingo's CPU scheduler update (in -mm kernels) needs a new sched_clock()
function which returns nanoseconds.

Stupid implementation which only gets it right on 1GHz CPUs.

I assume.  It's an undocumented miasma down there and if they can't be
bothered describing it then I can't be bothered decrypting it.  So there.



 arch/ppc64/kernel/time.c |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -puN arch/ppc64/kernel/time.c~ppc64-sched_clock arch/ppc64/kernel/time.c
--- 25-power4/arch/ppc64/kernel/time.c~ppc64-sched_clock	2003-08-02 13:40:46.000000000 -0700
+++ 25-power4-akpm/arch/ppc64/kernel/time.c	2003-08-02 13:44:43.000000000 -0700
@@ -308,6 +308,15 @@ int timer_interrupt(struct pt_regs * reg
 	return 1;
 }

+/*
+ * Scheduler clock - returns current time in nanosec units.
+ *
+ * This is wrong, but my CPUs run at 1GHz, so nyer nyer.
+ */
+unsigned long long sched_clock(void)
+{
+	return get_tb();
+}

 /*
  * This version of gettimeofday has microsecond resolution.

_


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list