public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin J. Bligh" <mbligh@aracnet.com>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Timer interrupt cleanups [3/3] - normalise calls
Date: Sun, 05 Jan 2003 18:35:22 -0800	[thread overview]
Message-ID: <200490000.1041820522@titus> (raw)

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 ??!!)

--------------------
diff -urpN -X /home/fletch/.diff.exclude 
02-rename_local_timer/arch/i386/kernel/apic.c 
03-normalise_placement/arch/i386/kernel/apic.c
--- 02-rename_local_timer/arch/i386/kernel/apic.c	Sun Jan  5 10:53:14 2003
+++ 03-normalise_placement/arch/i386/kernel/apic.c	Sun Jan  5 10:56:31 2003
@@ -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).
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
--- 02-rename_local_timer/include/asm-i386/mach-default/do_timer.h	Sun Jan 
5 10:51:02 2003
+++ 03-normalise_placement/include/asm-i386/mach-default/do_timer.h	Sun Jan 
5 10:56:31 2003
@@ -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
 }


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
--- 02-rename_local_timer/include/asm-i386/mach-visws/do_timer.h	Sun Jan  5 
10:51:02 2003
+++ 03-normalise_placement/include/asm-i386/mach-visws/do_timer.h	Sun Jan 
5 10:56:31 2003
@@ -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)
diff -urpN -X /home/fletch/.diff.exclude 
02-rename_local_timer/kernel/timer.c 03-normalise_placement/kernel/timer.c
--- 02-rename_local_timer/kernel/timer.c	Sat Jan  4 20:08:46 2003
+++ 03-normalise_placement/kernel/timer.c	Sun Jan  5 10:56:31 2003
@@ -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();
 }



                 reply	other threads:[~2003-01-06  2:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200490000.1041820522@titus \
    --to=mbligh@aracnet.com \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox