From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933565AbbDPKrk (ORCPT ); Thu, 16 Apr 2015 06:47:40 -0400 Received: from www.linutronix.de ([62.245.132.108]:43456 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757107AbbDPKrj (ORCPT ); Thu, 16 Apr 2015 06:47:39 -0400 Date: Thu, 16 Apr 2015 12:47:55 +0200 (CEST) From: Thomas Gleixner To: Fengguang Wu cc: LKP , Huang Ying , LKML Subject: Re: [hrtimer] WARNING: CPU: 0 PID: 0 at kernel/time/clockevents.c:318 clockevents_program_event() In-Reply-To: <20150416033736.GC31571@wfg-t540p.sh.intel.com> Message-ID: References: <20150416033736.GC31571@wfg-t540p.sh.intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Apr 2015, Fengguang Wu wrote: > Hi Thomas, > > 0day kernel testing robot got the below dmesg and the first bad commit is Thanks for the report. I found the issue and pushed the fix to timers/wip. Patch below. Thanks, tglx commit 0385d021dfeec82fdc94b4be5e74f45ababa7d73 Author: Thomas Gleixner Date: Thu Apr 16 12:42:04 2015 +0200 tick: Prevent periodic handler from stomping over highres/nohz mode We switch to highres/nohz from the hard interrupt context now. So the periodic handler will see event mode periodic and try to reschedule the timer interrupt. But that's not what we want as the hrtimer/nohz code is taking care of it. Check whether the eventhandler has changed and return. Needs to be folded back for the final merge. Fixes: 8ca99a56579 'hrtimer: Get rid of hrtimer softirq' Reported-by: Fengguang Wu Signed-off-by: Thomas Gleixner diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 3ae6afa1eb98..ea5f9eae8f74 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -102,6 +102,16 @@ void tick_handle_periodic(struct clock_event_device *dev) tick_periodic(cpu); +#if defined(CONFIG_HIGH_RES_TIMERS) || defined(CONFIG_NO_HZ_COMMON) + /* + * The cpu might have transitioned to HIGHRES or NOHZ mode via + * update_process_times() -> run_local_timers() -> + * hrtimer_run_queues(). + */ + if (dev->event_handler != tick_handle_periodic) + return; +#endif + if (dev->state != CLOCK_EVT_STATE_ONESHOT) return; for (;;) {