From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751835AbbEGNZt (ORCPT ); Thu, 7 May 2015 09:25:49 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:43969 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbbEGNZr (ORCPT ); Thu, 7 May 2015 09:25:47 -0400 Date: Thu, 7 May 2015 22:25:43 +0900 From: Simon Horman To: Thomas Gleixner Cc: linux-sh@vger.kernel.org, Peter Zijlstra , Magnus Damm , LKML , Ingo Molnar , LAK Subject: Re: Possible regression due to "hrtimer: Get rid of hrtimer softirq" Message-ID: <20150507132543.GA14889@verge.net.au> References: <20150507111711.GA17448@verge.net.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organisation: Horms Solutions Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, On Thu, May 07, 2015 at 02:35:59PM +0200, Thomas Gleixner wrote: > On Thu, 7 May 2015, Simon Horman wrote: > > ------------[ cut here ]------------ > > kernel BUG at kernel/irq_work.c:135! > > BUG_ON(!irqs_disabled()); > > So something enables interrupts in the periodic tick handling > machinery. Seems you have high resolution timers disabled, but nohz > enabled. And that code path has a local_irq_disable/enable pair which > causes havoc. Patch below. Thanks for your quick response. I have been able to confirm that when applied on top of next-20150507 the problem I observed no longer manifests. I have successfully tested it on all the boards where I previously observed a problem. If you are planning to formally submit the patch below feel free to add: Tested-by: Simon Horman > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c > index 753c211f6195..812f7a3b9898 100644 > --- a/kernel/time/tick-sched.c > +++ b/kernel/time/tick-sched.c > @@ -967,11 +967,9 @@ static void tick_nohz_switch_to_nohz(void) > if (!tick_nohz_enabled) > return; > > - local_irq_disable(); > - if (tick_switch_to_oneshot(tick_nohz_handler)) { > - local_irq_enable(); > + if (tick_switch_to_oneshot(tick_nohz_handler)) > return; > - } > + > tick_nohz_active = 1; > ts->nohz_mode = NOHZ_MODE_LOWRES; > > @@ -986,7 +984,6 @@ static void tick_nohz_switch_to_nohz(void) > hrtimer_forward_now(&ts->sched_timer, tick_period); > hrtimer_set_expires(&ts->sched_timer, next); > tick_program_event(next, 1); > - local_irq_enable(); > } > > /* > @@ -1171,7 +1168,7 @@ void tick_oneshot_notify(void) > * Called cyclic from the hrtimer softirq (driven by the timer > * softirq) allow_nohz signals, that we can switch into low-res nohz > * mode, because high resolution timers are disabled (either compile > - * or runtime). > + * or runtime). Called with interrupts disabled. > */ > int tick_check_oneshot_change(int allow_nohz) > { > > > > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >