All of lore.kernel.org
 help / color / mirror / Atom feed
From: rcochran-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org
To: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Anna-Maria Gleixner
	<anna-maria-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Sebastian Andrzej Siewior
	<bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Subject: Re: [patch 61/66] timers: Convert to hotplug state machine
Date: Tue, 26 Jul 2016 17:42:27 +0200	[thread overview]
Message-ID: <20160726154227.GC23707@linutronix.de> (raw)
In-Reply-To: <7d37714e-b072-ee90-f14f-364f4fd01f0d-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Jon,

On Mon, Jul 25, 2016 at 03:56:48PM +0100, Jon Hunter wrote:
> > When tearing down, call timers_dead_cpu before notify_dead.
> > There is a hidden dependency between:
> >
> > - timers
> > - Block multiqueue
> > - rcutree
> >
> > If timers_dead_cpu() comes later than blk_mq_queue_reinit_notify()
> > that latter function causes a RCU stall.
> 
> After this change is applied I am seeing RCU stalls during suspend
> on Tegra. I guess I am hitting the case mentioned above? How should
> this be avoided?

Contrary to the commit message, this callback ended up in the wrong
place within the sequence.  (It was correct in an earlier version, but
the series has been through many changes.)

Can you try this patch to see if it avoids the stall, please?

Thanks,
Richard
---

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..8d65510 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,11 @@ static struct cpuhp_step cpuhp_bp_states[] = {
 		.skip_onerr		= true,
 		.cant_stop		= true,
 	},
+	[CPUHP_TIMERS_DEAD] = {
+		.name = "timers dead",
+		.startup = NULL,
+		.teardown = timers_dead_cpu,
+	},
 	/* Kicks the plugged cpu into life */
 	[CPUHP_BRINGUP_CPU] = {
 		.name			= "cpu:bringup",

WARNING: multiple messages have this Message-ID (diff)
From: rcochran@linutronix.de
To: Jon Hunter <jonathanh@nvidia.com>
Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [patch 61/66] timers: Convert to hotplug state machine
Date: Tue, 26 Jul 2016 17:42:27 +0200	[thread overview]
Message-ID: <20160726154227.GC23707@linutronix.de> (raw)
In-Reply-To: <7d37714e-b072-ee90-f14f-364f4fd01f0d@nvidia.com>

Jon,

On Mon, Jul 25, 2016 at 03:56:48PM +0100, Jon Hunter wrote:
> > When tearing down, call timers_dead_cpu before notify_dead.
> > There is a hidden dependency between:
> >
> > - timers
> > - Block multiqueue
> > - rcutree
> >
> > If timers_dead_cpu() comes later than blk_mq_queue_reinit_notify()
> > that latter function causes a RCU stall.
> 
> After this change is applied I am seeing RCU stalls during suspend
> on Tegra. I guess I am hitting the case mentioned above? How should
> this be avoided?

Contrary to the commit message, this callback ended up in the wrong
place within the sequence.  (It was correct in an earlier version, but
the series has been through many changes.)

Can you try this patch to see if it avoids the stall, please?

Thanks,
Richard
---

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..8d65510 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,11 @@ static struct cpuhp_step cpuhp_bp_states[] = {
 		.skip_onerr		= true,
 		.cant_stop		= true,
 	},
+	[CPUHP_TIMERS_DEAD] = {
+		.name = "timers dead",
+		.startup = NULL,
+		.teardown = timers_dead_cpu,
+	},
 	/* Kicks the plugged cpu into life */
 	[CPUHP_BRINGUP_CPU] = {
 		.name			= "cpu:bringup",

  parent reply	other threads:[~2016-07-26 15:42 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 12:28 [patch 00/66] cpuhotplug: Convert all priority notifiers to the state machine Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 01/66] x86/vdso: Convert to hotplug " Anna-Maria Gleixner
2016-07-11 18:50   ` Andy Lutomirski
2016-07-11 12:28 ` [patch 03/66] irqchip/gicv3: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 02/66] irqchip/gic: " Anna-Maria Gleixner
2016-07-11 14:34   ` Ingo Molnar
2016-07-11 14:46     ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 04/66] irqchip/hip04: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 06/66] irqchip/bcm2836: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 05/66] irqchip/armada-370-xp: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 07/66] ARM: mvebu: " Anna-Maria Gleixner
2016-07-11 12:28   ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 09/66] perf/x86: Convert the core to the " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 08/66] perf: Convert to " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 10/66] perf/x86/intel/uncore: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 12/66] perf/x86/amd/ibs: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 11/66] perf/x86/amd/uncore: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 13/66] perf/x86/intel/rapl: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 14/66] perf/x86/intel/cqm: Convert Intel CQM " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 15/66] perf/x86/intel/cstate: Convert Intel CSTATE " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 17/66] powerpc: perf: Convert book3s notifier to state machine callbacks Anna-Maria Gleixner
2016-07-11 12:28   ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 16/66] blackfin: perf: Convert hotplug notifier to state machine Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 18/66] s390: perf: Convert the hotplug notifier to state machine callbacks (Counter) Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 19/66] s390: perf: Convert the hotplug notifier to state machine callbacks (Sampling) Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 20/66] sh: perf: Convert the hotplug notifiers to state machine callbacks Anna-Maria Gleixner
2016-07-11 12:28   ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 21/66] bus: arm-cci: convert to hotplug statemachine Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 23/66] xtensa: perf: Convert the hotplug notifier to state machine callbacks Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 22/66] bus: arm-ccn: convert to hotplug statemachine Anna-Maria Gleixner
2016-07-12 10:05   ` Pawel Moll
2016-07-12 11:16   ` Pawel Moll
2016-07-12 11:21     ` Sebastian Andrzej Siewior
2016-07-11 12:28 ` [patch 24/66] perf/x86/amd/power: Change hotplug notifier to a symmetric structure Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 25/66] perf/x86/amd/power: Convert the hotplug notifier to state machine Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 26/66] perf: Remove perf cpu notifier code Anna-Maria Gleixner
2016-07-11 14:36   ` Ingo Molnar
2016-07-11 14:50     ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 27/66] workqueue: Convert to state machine callbacks Anna-Maria Gleixner
2016-07-11 14:38   ` Ingo Molnar
2016-07-11 14:52     ` Anna-Maria Gleixner
2016-07-12 14:39   ` Tejun Heo
2016-07-11 12:28 ` [patch 28/66] x86/hpet: Convert to hotplug state machine Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 29/66] powerpc: numa: " Anna-Maria Gleixner
2016-07-11 12:28   ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 31/66] x86/kvm/kvmclock: " Anna-Maria Gleixner
2016-07-11 14:11   ` Anna-Maria Gleixner
2016-07-11 14:41   ` Paolo Bonzini
2016-07-11 12:28 ` [patch 30/66] KVM: x86: Remove superfluous SMP function call Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 32/66] x86/apb_timer: Convert to hotplug state machine Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 33/66] arm: Convert VFP hotplug notifiers to " Anna-Maria Gleixner
2016-07-11 12:28   ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 34/66] arm: perf: Convert to hotplug " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 36/66] ACPI/processor: avoid STARTING/DYING actions in a more logical way Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 35/66] virt: Convert kvm hotplug to state machine Anna-Maria Gleixner
2016-07-11 14:41   ` Paolo Bonzini
2016-07-11 12:28 ` [patch 37/66] clocksource/arm_arch_timer: Convert to hotplug " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 38/66] clocksource/arm_global_timer: " Anna-Maria Gleixner
2016-07-11 12:28   ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 39/66] clocksource/dummy_timer: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 40/66] clocksource/exynos_mct: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 41/66] clocksource/metag: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 42/66] clocksource/qcom-timer: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 44/66] clocksource/atlas7: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 43/66] clocksource/armada-370-xp: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 45/66] clocksource/mips-gic: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 46/66] leds: trigger: cpu: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 47/66] arm: kvm: vgic: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 48/66] arm: kvm: arch_timer: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 49/66] metag: perf: " Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 51/66] arm: twd: " Anna-Maria Gleixner
2016-07-11 12:28   ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 50/66] arm: l2c: " Anna-Maria Gleixner
2016-07-11 12:28   ` Anna-Maria Gleixner
2016-07-11 12:28 ` [patch 52/66] arm: xen: " Anna-Maria Gleixner
2016-07-11 12:28   ` Anna-Maria Gleixner
2016-07-11 12:29 ` [patch 53/66] MIPS: Loongson-3: Convert oprofile " Anna-Maria Gleixner
2016-07-11 15:57   ` Ralf Baechle
2016-07-11 12:29 ` [patch 54/66] hwtracing: coresight-etm3x: Convert " Anna-Maria Gleixner
2016-07-11 12:29   ` Anna-Maria Gleixner
2016-07-12 15:19   ` Mathieu Poirier
2016-07-12 15:19     ` Mathieu Poirier
2016-07-11 12:29 ` [patch 55/66] hwtracing: coresight-etm4x: " Anna-Maria Gleixner
2016-07-11 12:29   ` Anna-Maria Gleixner
2016-07-12 15:21   ` Mathieu Poirier
2016-07-12 15:21     ` Mathieu Poirier
2016-07-11 12:29 ` [patch 56/66] arm64: armv8 deprecated: " Anna-Maria Gleixner
2016-07-11 12:29   ` Anna-Maria Gleixner
2016-07-11 12:29 ` [patch 58/66] x86/tboot: " Anna-Maria Gleixner
2016-07-11 12:29 ` [patch 57/66] ARC/time: " Anna-Maria Gleixner
2016-07-11 12:29 ` [patch 59/66] rcu: Convert rcutree " Anna-Maria Gleixner
2016-07-11 18:38   ` Paul E. McKenney
2016-07-12 10:57     ` Anna-Maria Gleixner
2016-07-12 14:23       ` Paul E. McKenney
2016-08-18 17:35     ` Sebastian Andrzej Siewior
2016-08-18 18:30       ` Paul E. McKenney
2016-08-19 20:12         ` Sebastian Andrzej Siewior
2016-08-19 21:14           ` Paul E. McKenney
2016-07-11 12:29 ` [patch 60/66] hrtimer: Convert " Anna-Maria Gleixner
2016-07-11 12:29 ` [patch 61/66] timers: " Anna-Maria Gleixner
     [not found]   ` <20160711122535.775201614-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2016-07-25 14:56     ` Jon Hunter
2016-07-25 14:56       ` Jon Hunter
     [not found]       ` <7d37714e-b072-ee90-f14f-364f4fd01f0d-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-07-25 15:35         ` rcochran-hfZtesqFncYOwBW4kG4KsQ
2016-07-25 15:35           ` rcochran
     [not found]           ` <20160725153543.GB10939-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2016-07-25 20:46             ` rcochran-hfZtesqFncYOwBW4kG4KsQ
2016-07-25 20:46               ` rcochran
     [not found]               ` <20160725204648.GA22830-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2016-07-26  9:23                 ` Jon Hunter
2016-07-26  9:23                   ` Jon Hunter
2016-07-26  9:20           ` Jon Hunter
2016-07-26  9:20             ` Jon Hunter
2016-07-26 14:15             ` Thomas Gleixner
2016-07-26 18:20               ` Jon Hunter
2016-07-26 18:20                 ` Jon Hunter
     [not found]             ` <0b5a7bb5-6670-606b-e33d-63cd8b0fcedd-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-07-26 14:40               ` rcochran-hfZtesqFncYOwBW4kG4KsQ
2016-07-26 14:40                 ` rcochran
2016-07-26 18:22                 ` Jon Hunter
2016-07-26 18:22                   ` Jon Hunter
2016-07-26 15:42         ` rcochran-hfZtesqFncYOwBW4kG4KsQ [this message]
2016-07-26 15:42           ` rcochran
     [not found]           ` <20160726154227.GC23707-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2016-07-26 18:16             ` Jon Hunter
2016-07-26 18:16               ` Jon Hunter
2016-07-11 12:29 ` [patch 62/66] profile: " Anna-Maria Gleixner
2016-07-11 12:29 ` [patch 64/66] smp: Convert core " Anna-Maria Gleixner
2016-07-11 12:29 ` [patch 63/66] x86/x2apic: Convert to CPU " Anna-Maria Gleixner
2016-07-11 12:29 ` [patch 65/66] KVM: arm/arm64: vgic-new: Convert to " Anna-Maria Gleixner
2016-07-11 12:29 ` [patch 66/66] cpuhotplug: Remove CPU_STARTING and CPU_DYING notifier Anna-Maria 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=20160726154227.GC23707@linutronix.de \
    --to=rcochran-hfztesqfncyowbw4kg4ksq@public.gmane.org \
    --cc=anna-maria-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.