public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] fix "timer tick before it's due"
Date: Wed, 12 May 2004 23:42:07 +0000	[thread overview]
Message-ID: <16546.46671.935035.879125@napali.hpl.hp.com> (raw)
In-Reply-To: <200405121721.30863.bjorn.helgaas@hp.com>

>>>>> On Wed, 12 May 2004 17:21:30 -0600, Bjorn Helgaas <bjorn.helgaas@hp.com> said:

  Bjorn> Fix the "timer tick before it's due" complaint from timer_interrupt().
  Bjorn> The problem was that smp_callin() turned on the periodic timer tick
  Bjorn> before syncing the ITC with the BP.

  Bjorn> Syncing the ITC happens with interrupts disabled, and if you're
  Bjorn> unlucky enough to (1) pend a timer interrupt, and (2) set the ITC
  Bjorn> back before the ITM value that caused the timer interrupt, you
  Bjorn> can get stuck for several iterations in the following cycle
  Bjorn> (assume 100 clocks per tick):

The original idea was for ia64_sync_itc() to be safe to be called any
time (e.g., for CPU hotplug or in case we ever want to support
periodic re-syncing between CPUs).  Indeed, ia64_sync_itc() has this
code already:

	/*
	 * Check whether we sync'd the itc ahead of the next timer interrupt.
	 * If so, just reset it.
	 */
	if (time_after(ia64_get_itc(), local_cpu_data->itm_next)) {
		Dprintk("CPU %d: oops, jumped a timer tick; resetting timer.\n",
			smp_processor_id());
		ia64_cpu_local_tick();
	}

However, it's kind of hard to imagine a clean solution to the timer
tick problem you observed so I think it's reasonable to require that
timer ticks be disabled before syncing the ITCs.  If so, we should
state that assumption in a comment at least (a BUG_ON might be even
better).  Also, the above code can then be deleted from
ia64_sync_itc().

	--david

  reply	other threads:[~2004-05-12 23:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-12 23:21 [PATCH] fix "timer tick before it's due" Bjorn Helgaas
2004-05-12 23:42 ` David Mosberger [this message]
2004-05-13 19:02 ` Bjorn Helgaas
2004-05-13 20:33 ` David Mosberger
2004-05-13 21:25 ` Bjorn Helgaas
2004-05-13 22:36 ` 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=16546.46671.935035.879125@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox