mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Preeti U Murthy <preeti@linux.vnet.ibm.com>,
	Andriy Gapon <avg@freebsd.org>
Subject: Re: [patch 2/2] tick/broadcast: Handle spurious interrupts gracefully
Date: Mon, 6 Jul 2015 17:36:21 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.11.1507061735540.3916@nanos> (raw)
In-Reply-To: <CAPKp9ua9BUbPtyESvjesLbUBC2ZOGEb4_LeGwwX_Uf9pR22gDA@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2177 bytes --]

On Mon, 6 Jul 2015, Sudeep Holla wrote:
> On Sun, Jul 5, 2015 at 9:53 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > Andriy reported that on a virtual machine the warning about negative
> > expiry time in the clock events programming code triggered:
> >
> > hpet: hpet0 irq 40 for MSI
> > hpet: hpet1 irq 41 for MSI
> > Switching to clocksource hpet
> > WARNING: at kernel/time/clockevents.c:239
> >
> > [<ffffffff810ce6eb>] clockevents_program_event+0xdb/0xf0
> > [<ffffffff810cf211>] tick_handle_periodic_broadcast+0x41/0x50
> > [<ffffffff81016525>] timer_interrupt+0x15/0x20
> >
> > When the second hpet is installed as a per cpu timer the broadcast
> > event is not longer required and stopped, which sets the next_evt of
> > the broadcast device to KTIME_MAX.
> >
> > If after that a spurious interrupt happens on the broadcast device,
> > then the current code blindly handles it and tries to reprogram the
> > broadcast device afterwards, which adds the period to
> > next_evt. KTIME_MAX + period results in a negative expiry value
> > causing the WARN_ON in the clockevents code to trigger.
> >
> > Add a proper check for the state of the broadcast device into the
> > interrupt handler and return if the interrupt is spurious.
> >
> > Reported-by: Andriy Gapon <avg@FreeBSD.org>
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > ---
> >  kernel/time/tick-broadcast.c |    7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > Index: tip/kernel/time/tick-broadcast.c
> > ===================================================================
> > --- tip.orig/kernel/time/tick-broadcast.c
> > +++ tip/kernel/time/tick-broadcast.c
> > @@ -301,6 +301,13 @@ static void tick_handle_periodic_broadca
> >         bool bc_local;
> >
> >         raw_spin_lock(&tick_broadcast_lock);
> > +
> > +       /* Handle spurious interrupts gracefully */
> > +       if (clockevent_state_shutdown(&tick_broadcast_device.evtdev)) {
> 
> I tried this patch along with 1/2, found that this generating warning as
> tick_broadcast_device.evtdev is of type ‘struct clock_event_device *’ already,
> so it can be passed directly.

Right you are. The heat is melting my brain ...

  reply	other threads:[~2015-07-06 15:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-05 20:53 [patch 0/2] tic/broadcast: Plug a few corner cases which cause malfunction Thomas Gleixner
2015-07-05 20:53 ` [patch 1/2] tick/broadcast: Prevent deep idle states if no broadcast device available Thomas Gleixner
2015-07-06 15:09   ` Sudeep Holla
2015-07-06 15:35     ` Thomas Gleixner
2015-07-06 15:44       ` Sudeep Holla
2015-07-06 16:06         ` Thomas Gleixner
2015-07-06 16:27           ` Sudeep Holla
2015-07-06 16:53             ` Thomas Gleixner
2015-07-06 17:57               ` Sudeep Holla
2015-07-06 19:56                 ` Thomas Gleixner
2015-07-07  7:31                   ` Thomas Gleixner
2015-07-07 11:25                     ` Sudeep Holla
2015-07-07 11:55                       ` Thomas Gleixner
2015-07-07 17:12                     ` [tip:timers/urgent] tick/broadcast: Prevent hrtimer recursion tip-bot for Thomas Gleixner
2015-07-07 17:12                     ` [tip:timers/urgent] tick/broadcast: Sanity check the shutdown of the local clock_event tip-bot for Thomas Gleixner
2015-07-07 17:13                     ` [tip:timers/urgent] tick/broadcast: Make idle check independent from mode and config tip-bot for Thomas Gleixner
2015-07-07 17:13                     ` [tip:timers/urgent] tick/broadcast: Prevent deep idle if no broadcast device available tip-bot for Thomas Gleixner
2015-07-07 17:13                     ` [tip:timers/urgent] tick/broadcast: Move the check for periodic mode inside state handling tip-bot for Thomas Gleixner
2015-07-07 17:14                     ` [tip:timers/urgent] tick/broadcast: Return busy if periodic mode and hrtimer broadcast tip-bot for Thomas Gleixner
2015-07-07 17:14                     ` [tip:timers/urgent] tick/broadcast: Return busy when IPI is pending tip-bot for Thomas Gleixner
2015-07-07 17:14                     ` [tip:timers/urgent] tick/broadcast: Check for hrtimer broadcast active early tip-bot for Thomas Gleixner
2015-07-05 20:53 ` [patch 2/2] tick/broadcast: Handle spurious interrupts gracefully Thomas Gleixner
2015-07-06 15:17   ` Sudeep Holla
2015-07-06 15:36     ` Thomas Gleixner [this message]
2015-07-07 17:15   ` [tip:timers/urgent] " tip-bot for Thomas Gleixner

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=alpine.DEB.2.11.1507061735540.3916@nanos \
    --to=tglx@linutronix.de \
    --cc=avg@freebsd.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=sudeep.holla@arm.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

all inboxes | Powered by JetHome®