Skip to contentSkip to conversation

Timer interrupt cleanups [3/3] - normalise calls

PATCH New Martin J. Bligh 1 participant 1 message Jan 6, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Timer interrupt cleanups [3/3] - normalise calls

This patch moves x86_do_profile and update_process_times into do_local_timer for all systems.

It also makes do_global_timer_interrupt call do_local_timer on systems without the local apic timer (local apic timer simulation)

--------------------

Assuming we're SMP with a local apic timer all firing away:

global_timer_interrupt

	do_global_timer_interrupt
		{ack the interrupt}
		do_global_timer_interrupt_hook
			do_global_timer
				jiffies_64++;
				update_times
		{update CMOS clock}    (In the interrupt still ??!!)

local_apic_timer_interrupt

	do_local_apic_timer_interrupt
		{ack the interrupt}
		do_local_timer
			x86_do_profile
			update_process_times

--------------------

On UP with local apic timer:

global_timer_interrupt

	do_global_timer_interrupt
		{ack the interrupt}
		do_global_timer_interrupt_hook
			do_global_timer
				jiffies_64++;
				update_times
		{update CMOS clock}    (In the interrupt still ??!!)

local_apic_timer_interrupt

	do_local_apic_timer_interrupt
		{ack the interrupt}
		do_local_timer
			x86_do_profile
			update_process_times

--------------------

On a UP 386 with stale crusty breadcrumbs, and no local timer:

global_timer_interrupt

	do_global_timer_interrupt
		{ack the interrupt}
		do_global_timer_interrupt_hook
			do_global_timer
				jiffies_64++;
				update_times
			do_local_timer
				x86_do_profile
				update_process_times
		{update CMOS clock}    (In the interrupt still ??!!)

--------------------

arch/i386/kernel/apic.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude 02-rename_local_timer/arch/i386/kernel/apic.c 03-normalise_placement/arch/i386/kernel/apic.c
@@ -1012,11 +1012,18 @@ inline void do_local_timer(struct pt_reg
			prof_old_multiplier[cpu] = prof_counter[cpu];
		}

+ /*
+ * This is a bit of a mess ... not sure if we use multipliers
+ * on SMP ... the old code didn't. Someone who understands
+ * this better should clean up the #ifdef's below - mbligh
+ */

#ifdef CONFIG_SMP
		update_process_times(user_mode(regs));
#endif
	}

-
+#ifndef CONFIG_SMP
+ update_process_times(user_mode(regs));
+#endif
/*
* We take the 'long' return path, and there every subsystem
* grabs the apropriate locks (kernel lock/ irq lock).

include/asm-i386/mach-default/do_timer.h +0 -0
diff -urpN -X /home/fletch/.diff.exclude 02-rename_local_timer/include/asm-i386/mach-default/do_timer.h 03-normalise_placement/include/asm-i386/mach-default/do_timer.h
@@ -16,17 +16,9 @@

static inline void do_global_timer_interrupt_hook(struct pt_regs *regs)

{
	do_global_timer(regs);

-/*
- * In the SMP case we use the local APIC timer interrupt to do the
- * profiling, except when we simulate SMP mode on a uniprocessor
- * system, in that case we have to call the local interrupt handler.
- */
-#ifndef CONFIG_X86_LOCAL_APIC
- x86_do_profile(regs);
-#else
+

	if (!using_apic_timer)
		do_local_timer(regs);

-#endif
}

include/asm-i386/mach-visws/do_timer.h +0 -0
diff -urpN -X /home/fletch/.diff.exclude 02-rename_local_timer/include/asm-i386/mach-visws/do_timer.h 03-normalise_placement/include/asm-i386/mach-visws/do_timer.h
@@ -9,17 +9,9 @@ static inline void do_global_timer_inter
	co_cpu_write(CO_CPU_STAT,co_cpu_read(CO_CPU_STAT) & ~CO_STAT_TIMEINTR);

	do_global_timer(regs);

-/*
- * In the SMP case we use the local APIC timer interrupt to do the
- * profiling, except when we simulate SMP mode on a uniprocessor
- * system, in that case we have to call the local interrupt handler.
- */
-#ifndef CONFIG_X86_LOCAL_APIC
- x86_do_profile(regs);
-#else
+

	if (!using_apic_timer)
		do_local_timer(regs);

-#endif
}

static inline int do_timer_overflow(int count)

kernel/timer.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude 02-rename_local_timer/kernel/timer.c 03-normalise_placement/kernel/timer.c
@@ -806,11 +806,6 @@ static inline void update_times(void)

void do_global_timer(struct pt_regs *regs)

{
	jiffies_64++;

-#ifndef CONFIG_SMP
- /* SMP process accounting uses the local APIC timer */
-
- update_process_times(user_mode(regs));
-#endif

	update_times();
}