All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pat O'Rourke" <orourke@mclinux.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] [PATCH] Hundred percent system time
Date: Thu, 07 Sep 2000 18:12:28 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590678205462@msgid-missing> (raw)

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);
 	}
 }
 






             reply	other threads:[~2000-09-07 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-07 18:12 Pat O'Rourke [this message]
2000-09-07 18:35 ` [Linux-ia64] [PATCH] Hundred percent system time David Mosberger

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=marc-linux-ia64-105590678205462@msgid-missing \
    --to=orourke@mclinux.com \
    --cc=linux-ia64@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.