public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Nils Carlson <nils.carlson@ericsson.com>
Cc: <clemens@ladisch.de>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix periodic-emulation in HPET for delayed interrupts
Date: Wed, 8 Jun 2011 14:38:01 -0700	[thread overview]
Message-ID: <20110608143801.f494fa3e.akpm@linux-foundation.org> (raw)
In-Reply-To: <1306929530-23771-1-git-send-email-nils.carlson@ericsson.com>

On Wed, 1 Jun 2011 13:58:50 +0200
Nils Carlson <nils.carlson@ericsson.com> wrote:

> When interrupts are delayed due to interrupt masking or due
> to other interrupts being serviced the HPET periodic-emuation
> would fail. This happened because given an interval t and
> a time for the current interrupt m we would compute the next
> time as t + m. This works until we are delayed for > t, in
> which case we would be writing a new value which is in fact
> in the past.
> 
> This can be solved by computing the next time instead as
> (k * t) + m where k is large enough to be in the future.
> The exact computation of k is described in a comment to
> the code.
>
> ...
>
> +		/* The time for the next interrupt would logically be t + m,
> +		 * however, if we are very unlucky and the interrupt is delayed
> +		 * for longer than t then we will completely miss the next
> +		 * interrupt if we set t + m and an application will hang.

Strange.  Normally when hardware generates an interrupt it doesn't get
"missed".  It just sits there pending until the CPU accepts it.

What exactly causes this interrupt to be "delayed"?  Are you referring
to the CPU disabling local interrupts for too long, or something else?

And why does this delay cause the interrupt to be completely missed?

IOW, is the hpet hardware as busted as it sounds? ;)

And how serious is this bug?  Can the fix be delayed until 3.1, or is it
needed in 3.0?  2.6.x.y?

  reply	other threads:[~2011-06-08 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01 11:58 [PATCH] Fix periodic-emulation in HPET for delayed interrupts Nils Carlson
2011-06-08 21:38 ` Andrew Morton [this message]
2011-06-09  9:23   ` Nils Carlson

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=20110608143801.f494fa3e.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nils.carlson@ericsson.com \
    /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