public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] [PATCH] Hundred percent system time
@ 2000-09-07 18:12 Pat O'Rourke
  2000-09-07 18:35 ` David Mosberger
  0 siblings, 1 reply; 2+ messages in thread
From: Pat O'Rourke @ 2000-09-07 18:12 UTC (permalink / raw)
  To: linux-ia64

vmstat(8) was showing 100% system time on an "idle" system.  The problem
is that irq_enter() was being called twice for each clock interrupt; once
in handle_IRQ_event() and a second time in smp_do_timer():

	do_IRQ()
	|
	+-> handle_IRQ_event()
		|
		irq_enter()				// local_irq_count = 1
			|
			+-> timer_interrupt()
				|
				+-> smp_do_timer()
					|
					irq_enter	// local_irq_count = 2

As a result update_process_times() was attributing every clock tick as
occurring during an interrupt and therefore bumping up the per_cpu_system
counter.

I could see no other callers of smp_do_timer() other than timer_interrupt(),
and this will always be called via handle_IRQ_event.  So I believe that the
irq_enter/irq_exit in smp_do_timer() is not necessary and incorrect.  Is this
a true statement?  If so, this patch will remove the irq_enter/irq_exit from
smp_do_timer.

I've run this patch on a 4 cpu lion in SMP mode and UP mode (CONFIG_SMP
turned off as opposed to the nosmp boot option) and have not seen any ill
effects and the reported system time seems correct too.

Pat

-- 
Patrick O'Rourke
orourke@missioncriticallinux.com

--- linux-test7-plain/arch/ia64/kernel/smp.c	Thu Sep  7 12:26:32 2000
+++ linux-test7-patched/arch/ia64/kernel/smp.c	Thu Sep  7 12:32:00 2000
@@ -457,10 +457,12 @@
 		 * update_process_times() expects us to have done irq_enter().
 		 * Besides, if we don't timer interrupts ignore the global
 		 * interrupt lock, which is the WrongThing (tm) to do.
+		 *
+		 * [ The irq_enter() has been done in our caller, 	]
+		 * [ handle_IRQ_event, so we don't need to do it here.	]
+		 *
 		 */
-		irq_enter(cpu, 0);
 		update_process_times(user);
-		irq_exit(cpu, 0);
 	}
 }
 






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Linux-ia64] [PATCH] Hundred percent system time
  2000-09-07 18:12 [Linux-ia64] [PATCH] Hundred percent system time Pat O'Rourke
@ 2000-09-07 18:35 ` David Mosberger
  0 siblings, 0 replies; 2+ messages in thread
From: David Mosberger @ 2000-09-07 18:35 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Thu, 07 Sep 2000 14:12:28 -0400, "Pat O'Rourke" <orourke@mclinux.com> said:

  Pat> vmstat(8) was showing 100% system time on an "idle" system.
  Pat> The problem is that irq_enter() was being called twice for each
  Pat> clock interrupt; once in handle_IRQ_event() and a second time
  Pat> in smp_do_timer():

Yes, you are right.  This bug was introduced with test7 and, on the
x86 side, has been fixed with test8-preXX.  The patch looks fine.

	--david


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-09-07 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-09-07 18:12 [Linux-ia64] [PATCH] Hundred percent system time Pat O'Rourke
2000-09-07 18:35 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox