lkml.org 
[lkml]   [2004]   [Sep]   [23]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateWed, 22 Sep 2004 22:27:35 -0700
FromWilliam Lee Irwin III <>
SubjectRe: 2.6.9-rc2-mm2
On Wed, Sep 22, 2004 at 01:12:10PM -0700, Andrew Morton wrote:
>> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.9-rc2/2.6.9-rc2-mm2/
>> - Added Peter Williams' Single Priority Array (SPA) O(1) CPU Scheduler, aka
>>   the "zaphod" cpu scheduler.
>>   It has a number of tunables and lots of documentation - see the changelog
>>   entry in zaphod-scheduler.patch for details.

On Wed, Sep 22, 2004 at 10:07:40PM -0700, William Lee Irwin III wrote:
> Something's a tad off here. Should be easy enough to fix up.
[...]
> TPC: <sched_clock+0xc/0x40>

And easy it was indeed.


Index: mm2-2.6.9-rc2/arch/sparc64/kernel/time.c
===================================================================
--- mm2-2.6.9-rc2.orig/arch/sparc64/kernel/time.c	2004-09-22 21:33:03.000000000 -0700
+++ mm2-2.6.9-rc2/arch/sparc64/kernel/time.c	2004-09-22 22:16:00.647460690 -0700
@@ -1052,12 +1052,14 @@
 #endif
 }
 
+/* would be nice if we weren't called before time_init() */
 unsigned long long sched_clock(void)
 {
-	unsigned long ticks = tick_ops->get_tick();
-
-	return (ticks * timer_ticks_per_nsec_quotient)
-		>> SPARC64_NSEC_PER_CYC_SHIFT;
+	if (likely(tick_ops))
+		return (tick_ops->get_tick() * timer_ticks_per_nsec_quotient)
+			>> SPARC64_NSEC_PER_CYC_SHIFT;
+	else
+		return 0;
 }
 
 static int set_rtc_mmss(unsigned long nowtime)
-
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: 2005-03-22 14:06    [from the cache]
©2003-2008