From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932586AbcG1Pg5 (ORCPT ); Thu, 28 Jul 2016 11:36:57 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49666 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932559AbcG1Pgr (ORCPT ); Thu, 28 Jul 2016 11:36:47 -0400 Date: Thu, 28 Jul 2016 08:34:29 -0700 From: tip-bot for Richard Cochran Message-ID: Cc: oleg@redhat.com, bigeasy@linutronix.de, tglx@linutronix.de, linux-kernel@vger.kernel.org, john.stultz@linaro.org, jonathanh@nvidia.com, lkp@intel.com, mingo@kernel.org, torvalds@linux-foundation.org, hpa@zytor.com, linux@rasmusvillemoes.dk, peterz@infradead.org, rcochran@linutronix.de Reply-To: oleg@redhat.com, tglx@linutronix.de, bigeasy@linutronix.de, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, john.stultz@linaro.org, torvalds@linux-foundation.org, mingo@kernel.org, lkp@intel.com, linux@rasmusvillemoes.dk, hpa@zytor.com, rcochran@linutronix.de, peterz@infradead.org In-Reply-To: <1469610498-25914-1-git-send-email-rcochran@linutronix.de> References: <1469610498-25914-1-git-send-email-rcochran@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] timers/core: Correct callback order during CPU hot plug Git-Commit-ID: c713c8cb2055f5f3b32ee4315be589177a2658cc X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c713c8cb2055f5f3b32ee4315be589177a2658cc Gitweb: http://git.kernel.org/tip/c713c8cb2055f5f3b32ee4315be589177a2658cc Author: Richard Cochran AuthorDate: Wed, 27 Jul 2016 11:08:18 +0200 Committer: Thomas Gleixner CommitDate: Wed, 27 Jul 2016 12:38:08 +0200 timers/core: Correct callback order during CPU hot plug On the tear-down path, the dead CPU callback for the timers was misplaced within the 'cpuhp_state' enumeration. There is a hidden dependency between the timers and block multiqueue. The timers callback must happen before the block multiqueue callback otherwise a RCU stall occurs. Move the timers callback to the proper place in the state machine. Reported-and-tested-by: Jon Hunter Reported-by: kbuild test robot Fixes: 24f73b99716a ("timers/core: Convert to hotplug state machine") Signed-off-by: Richard Cochran Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Rasmus Villemoes Cc: John Stultz Cc: rt@linutronix.de Cc: Oleg Nesterov Cc: Linus Torvalds Link: http://lkml.kernel.org/r/1469610498-25914-1-git-send-email-rcochran@linutronix.de Signed-off-by: Thomas Gleixner --- include/linux/cpuhotplug.h | 2 +- kernel/cpu.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 6d405db..242bf53 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -20,9 +20,9 @@ enum cpuhp_state { CPUHP_PROFILE_PREPARE, CPUHP_X2APIC_PREPARE, CPUHP_SMPCFD_PREPARE, - CPUHP_TIMERS_DEAD, CPUHP_RCUTREE_PREP, CPUHP_NOTIFY_PREPARE, + CPUHP_TIMERS_DEAD, CPUHP_BRINGUP_CPU, CPUHP_AP_IDLE_DEAD, CPUHP_AP_OFFLINE, diff --git a/kernel/cpu.c b/kernel/cpu.c index 67f4943..ec12b72 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1208,11 +1208,6 @@ static struct cpuhp_step cpuhp_bp_states[] = { .startup = smpcfd_prepare_cpu, .teardown = smpcfd_dead_cpu, }, - [CPUHP_TIMERS_DEAD] = { - .name = "timers dead", - .startup = NULL, - .teardown = timers_dead_cpu, - }, [CPUHP_RCUTREE_PREP] = { .name = "RCU-tree prepare", .startup = rcutree_prepare_cpu, @@ -1229,6 +1224,16 @@ static struct cpuhp_step cpuhp_bp_states[] = { .skip_onerr = true, .cant_stop = true, }, + /* + * On the tear-down path, timers_dead_cpu() must be invoked + * before blk_mq_queue_reinit_notify() from notify_dead(), + * otherwise a RCU stall occurs. + */ + [CPUHP_TIMERS_DEAD] = { + .name = "timers dead", + .startup = NULL, + .teardown = timers_dead_cpu, + }, /* Kicks the plugged cpu into life */ [CPUHP_BRINGUP_CPU] = { .name = "cpu:bringup",