Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1442667 > unrolled thread
| Started by | Anna-Maria Gleixner <anna-maria@linutronix.de> |
|---|---|
| First post | 2016-07-13 19:30 +0200 |
| Last post | 2016-07-13 21:40 +0200 |
| Articles | 20 on this page of 117 — 18 participants |
Back to article view | Back to linux.kernel
[patch V2 00/67] cpuhotplug: Convert all priority notifiers to the state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[patch V2 26/67] perf/x86/amd/power: Convert the hotplug notifier to state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] perf/x86/amd/power: Convert the hotplug notifier to state machine tip-bot for Anna-Maria Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 49/67] arm/xen: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
Re: [patch V2 49/67] arm/xen: Convert to hotplug state machine Stefano Stabellini <sstabellini@kernel.org> - 2016-07-13 20:30 +0200
[tip:smp/hotplug] arm/xen: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 51/67] hwtracing/coresight-etm3x: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] hwtracing/coresight-etm3x: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 59/67] smp: Convert core to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] smp/cfd: Convert core to hotplug state machine tip-bot for Richard Weinberger <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 55/67] hrtimer: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] hrtimer: Convert to hotplug state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 27/67] perf/core: Remove perf CPU notifier code Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] perf/core: Remove perf CPU notifier code tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 40/67] clocksource/metag: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] clocksource/metag: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 21/67] sh/perf: Convert the hotplug notifiers to state machine callbacks Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] sh/perf: Convert the hotplug notifiers to state machine callbacks tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 13/67] perf/x86/amd/ibs: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] perf/x86/amd/ibs: Convert to hotplug state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 17/67] blackfin/perf: Convert hotplug notifier to state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] blackfin/perf: Convert hotplug notifier to state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 28/67] workqueue: Convert to state machine callbacks Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] workqueue: Convert to state machine callbacks tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 56/67] timers/core: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] timers/core: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 54/67] x86/tboot: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] x86/tboot: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 42/67] clocksource/mips-gic: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] clocksource/mips-gic: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 48/67] arm/twd: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] arm/twd: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 64/67] clocksource/armada-370-xp: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] clocksource/armada-370-xp: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:40 +0200
[patch V2 47/67] arm/l2c: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
[tip:smp/hotplug] arm/l2c: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-14 09:20 +0200
Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Ingo Molnar <mingo@kernel.org> - 2016-07-14 09:50 +0200
Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-14 10:20 +0200
Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Peter Zijlstra <peterz@infradead.org> - 2016-07-14 11:50 +0200
Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-14 13:30 +0200
Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Thomas Gleixner <tglx@linutronix.de> - 2016-07-14 13:40 +0200
Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-14 14:00 +0200
Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-15 16:20 +0200
Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-18 10:30 +0200
[tip:smp/hotplug] leds/trigger/cpu: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 60/67] KVM/arm/arm64/vgic-new: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
Re: [patch V2 60/67] KVM/arm/arm64/vgic-new: Convert to hotplug state machine Marc Zyngier <marc.zyngier@arm.com> - 2016-07-14 15:10 +0200
[tip:smp/hotplug] KVM/arm/arm64/vgic-new: Convert to hotplug state machine tip-bot for Anna-Maria Gleixner <tipbot@zytor.com> - 2016-07-19 09:40 +0200
[patch V2 14/67] perf/x86/intel/rapl: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] perf/x86/intel/rapl: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 01/67] cpuhotplug: Handle early registration gracefully Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] cpu/hotplug: Handle early registration gracefully tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:00 +0200
[patch V2 32/67] x86/kvm/kvmclock: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] x86/kvm/kvmclock: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 07/67] irqchip/bcm2836: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] irqchip/bcm2836: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 18/67] powerpc/perf: Convert book3s notifier to state machine callbacks Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] powerpc/perf: Convert book3s notifier to state machine callbacks tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 08/67] ARM: mvebu: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] ARM/mvebu: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 24/67] xtensa/perf: Convert the hotplug notifier to state machine callbacks Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] xtensa/perf: Convert the hotplug notifier to state machine callbacks tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 11/67] perf/x86/intel/uncore: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] perf/x86/intel/uncore: Convert to hotplug state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 23/67] bus/arm-ccn: Convert to hotplug statemachine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
Re: [patch V2 23/67] bus/arm-ccn: Convert to hotplug statemachine Pawel Moll <pawel.moll@arm.com> - 2016-07-18 20:40 +0200
[tip:smp/hotplug] bus/arm-ccn: Convert to hotplug statemachine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 25/67] perf/x86/amd/power: Change hotplug notifier to a symmetric structure Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] perf/x86/amd/power: Change hotplug notifier to a symmetric structure tip-bot for Anna-Maria Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 20/67] s390/perf: Convert the hotplug notifier to state machine callbacks (Sampling) Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] s390/perf: Convert the hotplug notifier to state machine callbacks (Sampling) tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 33/67] x86/apb_timer: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] x86/apb_timer: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 61/67] rcu: Convert rcutree to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] rcu: Convert rcutree to hotplug state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:40 +0200
[patch V2 31/67] KVM/x86: Remove superfluous SMP function call Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
Re: [patch V2 31/67] KVM/x86: Remove superfluous SMP function call Paolo Bonzini <pbonzini@redhat.com> - 2016-07-14 10:30 +0200
[tip:smp/hotplug] KVM/x86: Remove superfluous SMP function call tip-bot for Anna-Maria Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 09/67] perf/core: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] perf/core: Convert to hotplug state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 16/67] perf/x86/intel/cstate: Convert Intel CSTATE to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] perf/x86/intel/cstate: Convert Intel CSTATE to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 22/67] bus/arm-cci: Convert to hotplug statemachine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
Re: [patch V2 22/67] bus/arm-cci: Convert to hotplug statemachine Punit Agrawal <punit.agrawal@arm.com> - 2016-07-15 14:40 +0200
[tip:smp/hotplug] bus/arm-cci: Convert to hotplug statemachine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
[patch V2 34/67] arm: Convert VFP hotplug notifiers to state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] arm: Convert VFP hotplug notifiers to state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 36/67] virt: Convert kvm hotplug to state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] virt: Convert kvm hotplug to state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 37/67] ACPI/processor: Avoid STARTING/DYING actions in a more logical way Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] ACPI/processor: Avoid STARTING/DYING actions in a more logical way tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 41/67] clocksource/qcom-timer: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] clocksource/qcom-timer: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 52/67] hwtracing/coresight-etm4x: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] hwtracing/coresight-etm4x: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 38/67] clocksource/arm_arch_timer: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] clocksource/arm_arch_timer: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:20 +0200
[patch V2 45/67] arm/kvm/arch_timer: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] arm/kvm/arch_timer: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anton Blanchard <anton@samba.org> - 2016-07-14 23:50 +0200
Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-15 02:10 +0200
Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anton Blanchard <anton@samba.org> - 2016-07-15 02:30 +0200
Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Ingo Molnar <mingo@kernel.org> - 2016-07-15 10:50 +0200
Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anton Blanchard <anton@samba.org> - 2016-07-15 14:20 +0200
Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-15 18:30 +0200
[PATCH v2] powerpc/numa: Convert to hotplug state machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-18 16:10 +0200
[tip:smp/hotplug] powerpc/numa: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-22 22:00 +0200
[patch V2 46/67] metag/perf: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] metag/perf: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 57/67] profile: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] profile: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:30 +0200
[patch V2 12/67] perf/x86/amd/uncore: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
[tip:smp/hotplug] perf/x86/amd/uncore: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:10 +0200
Re: [patch V2 00/67] cpuhotplug: Convert all priority notifiers to the state machine Jason Cooper <jason@lakedaemon.net> - 2016-07-13 21:40 +0200
Page 3 of 6 — ← Prev page 1 2 [3] 4 5 6 Next page →
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2016-07-14 11:50 +0200 |
| Subject | Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine |
| Message-ID | <rULrk-7WZ-19@gated-at.bofh.it> |
| In reply to | #1443161 |
On Thu, Jul 14, 2016 at 10:10:55AM +0200, Jacek Anaszewski wrote: > On 07/14/2016 09:47 AM, Ingo Molnar wrote: > > > >* Jacek Anaszewski <j.anaszewski@samsung.com> wrote: > > > >>>@@ -133,7 +125,13 @@ static int __init ledtrig_cpu_init(void) > >>> } > >>> > >>> register_syscore_ops(&ledtrig_cpu_syscore_ops); > >>>- register_cpu_notifier(&ledtrig_cpu_nb); > >>>+ > >>>+ /* > >>>+ * FIXME: Why needs this to happen in the interrupt disabled > >>>+ * low level bringup phase of a cpu? > >>>+ */ > Thanks for the explanation. I'm OK with that approach. Since we have your attention, could you perhaps attempt to answer the question so we can fix the fixme?
[toc] | [prev] | [next] | [standalone]
| From | Jacek Anaszewski <j.anaszewski@samsung.com> |
|---|---|
| Date | 2016-07-14 13:30 +0200 |
| Subject | Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine |
| Message-ID | <rUN06-BW-7@gated-at.bofh.it> |
| In reply to | #1443327 |
On 07/14/2016 11:41 AM, Peter Zijlstra wrote: > On Thu, Jul 14, 2016 at 10:10:55AM +0200, Jacek Anaszewski wrote: >> On 07/14/2016 09:47 AM, Ingo Molnar wrote: >>> >>> * Jacek Anaszewski <j.anaszewski@samsung.com> wrote: >>> >>>>> @@ -133,7 +125,13 @@ static int __init ledtrig_cpu_init(void) >>>>> } >>>>> >>>>> register_syscore_ops(&ledtrig_cpu_syscore_ops); >>>>> - register_cpu_notifier(&ledtrig_cpu_nb); >>>>> + >>>>> + /* >>>>> + * FIXME: Why needs this to happen in the interrupt disabled >>>>> + * low level bringup phase of a cpu? >>>>> + */ > >> Thanks for the explanation. I'm OK with that approach. > > Since we have your attention, could you perhaps attempt to answer the > question so we can fix the fixme? > This is the way how all led triggers are being registered. Once a trigger module is loaded it needs to be registered in the LED Trigger core. -- Best regards, Jacek Anaszewski
[toc] | [prev] | [next] | [standalone]
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Date | 2016-07-14 13:40 +0200 |
| Subject | Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine |
| Message-ID | <rUN9M-G3-31@gated-at.bofh.it> |
| In reply to | #1443362 |
On Thu, 14 Jul 2016, Jacek Anaszewski wrote: > On 07/14/2016 11:41 AM, Peter Zijlstra wrote: > > On Thu, Jul 14, 2016 at 10:10:55AM +0200, Jacek Anaszewski wrote: > > > On 07/14/2016 09:47 AM, Ingo Molnar wrote: > > > > > > > > * Jacek Anaszewski <j.anaszewski@samsung.com> wrote: > > > > > > > > > > @@ -133,7 +125,13 @@ static int __init ledtrig_cpu_init(void) > > > > > > } > > > > > > > > > > > > register_syscore_ops(&ledtrig_cpu_syscore_ops); > > > > > > - register_cpu_notifier(&ledtrig_cpu_nb); > > > > > > + > > > > > > + /* > > > > > > + * FIXME: Why needs this to happen in the interrupt disabled > > > > > > + * low level bringup phase of a cpu? > > > > > > + */ > > > > > Thanks for the explanation. I'm OK with that approach. > > > > Since we have your attention, could you perhaps attempt to answer the > > question so we can fix the fixme? > > > > This is the way how all led triggers are being registered. > > Once a trigger module is loaded it needs to be registered in > the LED Trigger core. That does not explain WHY this needs to happen in the low level bringup phase of the CPU with interrupts disabled and can't be done from the normal ONLINE callbacks in thread context. Thanks, tglx
[toc] | [prev] | [next] | [standalone]
| From | Jacek Anaszewski <j.anaszewski@samsung.com> |
|---|---|
| Date | 2016-07-14 14:00 +0200 |
| Subject | Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine |
| Message-ID | <rUNt7-N5-3@gated-at.bofh.it> |
| In reply to | #1443381 |
On 07/14/2016 01:33 PM, Thomas Gleixner wrote: > On Thu, 14 Jul 2016, Jacek Anaszewski wrote: >> On 07/14/2016 11:41 AM, Peter Zijlstra wrote: >>> On Thu, Jul 14, 2016 at 10:10:55AM +0200, Jacek Anaszewski wrote: >>>> On 07/14/2016 09:47 AM, Ingo Molnar wrote: >>>>> >>>>> * Jacek Anaszewski <j.anaszewski@samsung.com> wrote: >>>>> >>>>>>> @@ -133,7 +125,13 @@ static int __init ledtrig_cpu_init(void) >>>>>>> } >>>>>>> >>>>>>> register_syscore_ops(&ledtrig_cpu_syscore_ops); >>>>>>> - register_cpu_notifier(&ledtrig_cpu_nb); >>>>>>> + >>>>>>> + /* >>>>>>> + * FIXME: Why needs this to happen in the interrupt disabled >>>>>>> + * low level bringup phase of a cpu? >>>>>>> + */ >>> >>>> Thanks for the explanation. I'm OK with that approach. >>> >>> Since we have your attention, could you perhaps attempt to answer the >>> question so we can fix the fixme? >>> >> >> This is the way how all led triggers are being registered. >> >> Once a trigger module is loaded it needs to be registered in >> the LED Trigger core. > > That does not explain WHY this needs to happen in the low level bringup phase > of the CPU with interrupts disabled and can't be done from the normal ONLINE > callbacks in thread context. It was before my time in kernel, so I can only suppose that it was the easiest way. Does it introduce some problems? -- Best regards, Jacek Anaszewski
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
|---|---|
| Date | 2016-07-15 16:20 +0200 |
| Subject | Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine |
| Message-ID | <rVc89-7Vx-15@gated-at.bofh.it> |
| In reply to | #1443386 |
* Jacek Anaszewski | 2016-07-14 13:55:26 [+0200]:
>On 07/14/2016 01:33 PM, Thomas Gleixner wrote:
>>That does not explain WHY this needs to happen in the low level bringup phase
>>of the CPU with interrupts disabled and can't be done from the normal ONLINE
>>callbacks in thread context.
>
>It was before my time in kernel, so I can only suppose that it was
>the easiest way. Does it introduce some problems?
It was introduced by Pawel Moll in fba14ae8e924 ("ledtrig-cpu: Handle
CPU hot(un)plugging"). It does not introduce any problems but those
bring up / bring down levels are usually used by the core code. This
does not look like it needs to be done _that_ early or late during the
removal / addition of a CPU to the system.
Which means this looks like it could be moved to CPU_ONLINE /
CPU_DOWN_PREPARE which in turns means we could use dynamic IDs instead
of those hardcoded ones since the LED subsystem does not depend on other
components.
Sebastian
[toc] | [prev] | [next] | [standalone]
| From | Jacek Anaszewski <j.anaszewski@samsung.com> |
|---|---|
| Date | 2016-07-18 10:30 +0200 |
| Subject | Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine |
| Message-ID | <rWc66-3Ku-5@gated-at.bofh.it> |
| In reply to | #1444342 |
Hi Sebastian,
On 07/15/2016 04:10 PM, Sebastian Andrzej Siewior wrote:
> * Jacek Anaszewski | 2016-07-14 13:55:26 [+0200]:
>
>> On 07/14/2016 01:33 PM, Thomas Gleixner wrote:
>>> That does not explain WHY this needs to happen in the low level bringup phase
>>> of the CPU with interrupts disabled and can't be done from the normal ONLINE
>>> callbacks in thread context.
>>
>> It was before my time in kernel, so I can only suppose that it was
>> the easiest way. Does it introduce some problems?
>
> It was introduced by Pawel Moll in fba14ae8e924 ("ledtrig-cpu: Handle
> CPU hot(un)plugging"). It does not introduce any problems but those
> bring up / bring down levels are usually used by the core code. This
> does not look like it needs to be done _that_ early or late during the
> removal / addition of a CPU to the system.
>
> Which means this looks like it could be moved to CPU_ONLINE /
> CPU_DOWN_PREPARE which in turns means we could use dynamic IDs instead
> of those hardcoded ones since the LED subsystem does not depend on other
> components.
From the LED subsystem perspective I don't see any particular reason
for which it couldn't be accomplished from the ONLINE callbacks.
--
Best regards,
Jacek Anaszewski
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Richard Cochran <tipbot@zytor.com> |
|---|---|
| Date | 2016-07-19 09:30 +0200 |
| Subject | [tip:smp/hotplug] leds/trigger/cpu: Convert to hotplug state machine |
| Message-ID | <rWxDB-15B-51@gated-at.bofh.it> |
| In reply to | #1442687 |
Commit-ID: 911a359de96d5e9d24f50c74a48c6f3cf061539a
Gitweb: http://git.kernel.org/tip/911a359de96d5e9d24f50c74a48c6f3cf061539a
Author: Richard Cochran <rcochran@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:45 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:40:26 +0200
leds/trigger/cpu: Convert to hotplug state machine
This is a straightforward conversion. We place this callback last
in the list so that the LED illuminates only after a successful
bring up sequence.
( NOTE: The patch adds a FIXME question about the callback used,
this question should probably be revisited later on.)
Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-leds@vger.kernel.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153336.465496902@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
drivers/leds/trigger/ledtrig-cpu.c | 32 +++++++++++++++-----------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/leds/trigger/ledtrig-cpu.c b/drivers/leds/trigger/ledtrig-cpu.c
index 938467f..4a6a182 100644
--- a/drivers/leds/trigger/ledtrig-cpu.c
+++ b/drivers/leds/trigger/ledtrig-cpu.c
@@ -92,25 +92,17 @@ static struct syscore_ops ledtrig_cpu_syscore_ops = {
.resume = ledtrig_cpu_syscore_resume,
};
-static int ledtrig_cpu_notify(struct notifier_block *self,
- unsigned long action, void *hcpu)
+static int ledtrig_starting_cpu(unsigned int cpu)
{
- switch (action & ~CPU_TASKS_FROZEN) {
- case CPU_STARTING:
- ledtrig_cpu(CPU_LED_START);
- break;
- case CPU_DYING:
- ledtrig_cpu(CPU_LED_STOP);
- break;
- }
-
- return NOTIFY_OK;
+ ledtrig_cpu(CPU_LED_START);
+ return 0;
}
-
-static struct notifier_block ledtrig_cpu_nb = {
- .notifier_call = ledtrig_cpu_notify,
-};
+static int ledtrig_dying_cpu(unsigned int cpu)
+{
+ ledtrig_cpu(CPU_LED_STOP);
+ return 0;
+}
static int __init ledtrig_cpu_init(void)
{
@@ -133,7 +125,13 @@ static int __init ledtrig_cpu_init(void)
}
register_syscore_ops(&ledtrig_cpu_syscore_ops);
- register_cpu_notifier(&ledtrig_cpu_nb);
+
+ /*
+ * FIXME: Why needs this to happen in the interrupt disabled
+ * low level bringup phase of a cpu?
+ */
+ cpuhp_setup_state(CPUHP_AP_LEDTRIG_STARTING, "AP_LEDTRIG_STARTING",
+ ledtrig_starting_cpu, ledtrig_dying_cpu);
pr_info("ledtrig-cpu: registered to indicate activity on CPUs\n");
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 456e3d9..24f56e2 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -42,6 +42,7 @@ enum cpuhp_state {
CPUHP_AP_QCOM_TIMER_STARTING,
CPUHP_AP_MIPS_GIC_TIMER_STARTING,
CPUHP_AP_KVM_STARTING,
+ CPUHP_AP_LEDTRIG_STARTING,
CPUHP_AP_NOTIFY_STARTING,
CPUHP_AP_ONLINE,
CPUHP_TEARDOWN_CPU,
[toc] | [prev] | [next] | [standalone]
| From | Anna-Maria Gleixner <anna-maria@linutronix.de> |
|---|---|
| Date | 2016-07-13 19:30 +0200 |
| Subject | [patch V2 60/67] KVM/arm/arm64/vgic-new: Convert to hotplug state machine |
| Message-ID | <rUw8Y-67L-91@gated-at.bofh.it> |
| In reply to | #1442667 |
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Eric Auger <eric.auger@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Radim Krcmar <rkrcmar@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kvm@vger.kernel.org
Cc: kvmarm@lists.cs.columbia.edu
Cc: linux-arm-kernel@lists.infradead.org
---
include/linux/cpuhotplug.h | 1 +
virt/kvm/arm/vgic/vgic-init.c | 31 +++++++++----------------------
2 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 078bd22..822df54 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -52,6 +52,7 @@ enum cpuhp_state {
CPUHP_AP_QCOM_TIMER_STARTING,
CPUHP_AP_MIPS_GIC_TIMER_STARTING,
CPUHP_AP_KVM_STARTING,
+ CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
CPUHP_AP_KVM_ARM_VGIC_STARTING,
CPUHP_AP_KVM_ARM_TIMER_STARTING,
CPUHP_AP_ARM_XEN_STARTING,
diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c
index a1442f7..2c7f0d5 100644
--- a/virt/kvm/arm/vgic/vgic-init.c
+++ b/virt/kvm/arm/vgic/vgic-init.c
@@ -353,32 +353,19 @@ out:
/* GENERIC PROBE */
-static void vgic_init_maintenance_interrupt(void *info)
+static int vgic_init_cpu_starting(unsigned int cpu)
{
enable_percpu_irq(kvm_vgic_global_state.maint_irq, 0);
+ return 0;
}
-static int vgic_cpu_notify(struct notifier_block *self,
- unsigned long action, void *cpu)
-{
- switch (action) {
- case CPU_STARTING:
- case CPU_STARTING_FROZEN:
- vgic_init_maintenance_interrupt(NULL);
- break;
- case CPU_DYING:
- case CPU_DYING_FROZEN:
- disable_percpu_irq(kvm_vgic_global_state.maint_irq);
- break;
- }
- return NOTIFY_OK;
+static int vgic_init_cpu_dying(unsigned int cpu)
+{
+ disable_percpu_irq(kvm_vgic_global_state.maint_irq);
+ return 0;
}
-static struct notifier_block vgic_cpu_nb = {
- .notifier_call = vgic_cpu_notify,
-};
-
static irqreturn_t vgic_maintenance_handler(int irq, void *data)
{
/*
@@ -434,14 +421,14 @@ int kvm_vgic_hyp_init(void)
return ret;
}
- ret = __register_cpu_notifier(&vgic_cpu_nb);
+ ret = cpuhp_setup_state(CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
+ "AP_KVM_ARM_VGIC_INIT_STARTING",
+ vgic_init_cpu_starting, vgic_init_cpu_dying);
if (ret) {
kvm_err("Cannot register vgic CPU notifier\n");
goto out_free_irq;
}
- on_each_cpu(vgic_init_maintenance_interrupt, NULL, 1);
-
kvm_info("vgic interrupt IRQ%d\n", kvm_vgic_global_state.maint_irq);
return 0;
--
2.8.1
[toc] | [prev] | [next] | [standalone]
| From | Marc Zyngier <marc.zyngier@arm.com> |
|---|---|
| Date | 2016-07-14 15:10 +0200 |
| Subject | Re: [patch V2 60/67] KVM/arm/arm64/vgic-new: Convert to hotplug state machine |
| Message-ID | <rUOyS-1GD-19@gated-at.bofh.it> |
| In reply to | #1442688 |
On 13/07/16 18:17, Anna-Maria Gleixner wrote: > From: Anna-Maria Gleixner <anna-maria@linutronix.de> > > Install the callbacks via the state machine and let the core invoke > the callbacks on the already online CPUs. > > Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> > Cc: Andre Przywara <andre.przywara@arm.com> > Cc: Christoffer Dall <christoffer.dall@linaro.org> > Cc: Eric Auger <eric.auger@linaro.org> > Cc: Linus Torvalds <torvalds@linux-foundation.org> > Cc: Marc Zyngier <marc.zyngier@arm.com> > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: Peter Zijlstra <peterz@infradead.org> > Cc: Radim Krcmar <rkrcmar@redhat.com> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: kvm@vger.kernel.org > Cc: kvmarm@lists.cs.columbia.edu > Cc: linux-arm-kernel@lists.infradead.org For patches 3, 4, 5, 6, 7, 44, 45 and 60: Acked-by: Marc Zyngier <marc.zyngier@arm.com> Thanks, M. -- Jazz is not dead. It just smells funny...
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Anna-Maria Gleixner <tipbot@zytor.com> |
|---|---|
| Date | 2016-07-19 09:40 +0200 |
| Subject | [tip:smp/hotplug] KVM/arm/arm64/vgic-new: Convert to hotplug state machine |
| Message-ID | <rWxNg-18Q-1@gated-at.bofh.it> |
| In reply to | #1442688 |
Commit-ID: 15d7e3d349a329ad48a29c3a818eacd1c3f7e3ef
Gitweb: http://git.kernel.org/tip/15d7e3d349a329ad48a29c3a818eacd1c3f7e3ef
Author: Anna-Maria Gleixner <anna-maria@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:17:02 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:41:43 +0200
KVM/arm/arm64/vgic-new: Convert to hotplug state machine
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Eric Auger <eric.auger@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Radim Krcmar <rkrcmar@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kvm@vger.kernel.org
Cc: kvmarm@lists.cs.columbia.edu
Cc: linux-arm-kernel@lists.infradead.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153337.900484868@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
include/linux/cpuhotplug.h | 1 +
virt/kvm/arm/vgic/vgic-init.c | 31 +++++++++----------------------
2 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index b5cf01a..544b556 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -51,6 +51,7 @@ enum cpuhp_state {
CPUHP_AP_QCOM_TIMER_STARTING,
CPUHP_AP_MIPS_GIC_TIMER_STARTING,
CPUHP_AP_KVM_STARTING,
+ CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
CPUHP_AP_KVM_ARM_VGIC_STARTING,
CPUHP_AP_KVM_ARM_TIMER_STARTING,
CPUHP_AP_ARM_XEN_STARTING,
diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c
index a1442f7..2c7f0d5 100644
--- a/virt/kvm/arm/vgic/vgic-init.c
+++ b/virt/kvm/arm/vgic/vgic-init.c
@@ -353,32 +353,19 @@ out:
/* GENERIC PROBE */
-static void vgic_init_maintenance_interrupt(void *info)
+static int vgic_init_cpu_starting(unsigned int cpu)
{
enable_percpu_irq(kvm_vgic_global_state.maint_irq, 0);
+ return 0;
}
-static int vgic_cpu_notify(struct notifier_block *self,
- unsigned long action, void *cpu)
-{
- switch (action) {
- case CPU_STARTING:
- case CPU_STARTING_FROZEN:
- vgic_init_maintenance_interrupt(NULL);
- break;
- case CPU_DYING:
- case CPU_DYING_FROZEN:
- disable_percpu_irq(kvm_vgic_global_state.maint_irq);
- break;
- }
- return NOTIFY_OK;
+static int vgic_init_cpu_dying(unsigned int cpu)
+{
+ disable_percpu_irq(kvm_vgic_global_state.maint_irq);
+ return 0;
}
-static struct notifier_block vgic_cpu_nb = {
- .notifier_call = vgic_cpu_notify,
-};
-
static irqreturn_t vgic_maintenance_handler(int irq, void *data)
{
/*
@@ -434,14 +421,14 @@ int kvm_vgic_hyp_init(void)
return ret;
}
- ret = __register_cpu_notifier(&vgic_cpu_nb);
+ ret = cpuhp_setup_state(CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
+ "AP_KVM_ARM_VGIC_INIT_STARTING",
+ vgic_init_cpu_starting, vgic_init_cpu_dying);
if (ret) {
kvm_err("Cannot register vgic CPU notifier\n");
goto out_free_irq;
}
- on_each_cpu(vgic_init_maintenance_interrupt, NULL, 1);
-
kvm_info("vgic interrupt IRQ%d\n", kvm_vgic_global_state.maint_irq);
return 0;
[toc] | [prev] | [next] | [standalone]
| From | Anna-Maria Gleixner <anna-maria@linutronix.de> |
|---|---|
| Date | 2016-07-13 19:40 +0200 |
| Subject | [patch V2 14/67] perf/x86/intel/rapl: Convert to hotplug state machine |
| Message-ID | <rUwiB-6ch-1@gated-at.bofh.it> |
| In reply to | #1442667 |
From: Richard Cochran <rcochran@linutronix.de>
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
arch/x86/events/intel/rapl.c | 84 +++++++++++++-------------------------------
include/linux/cpuhotplug.h | 2 ++
2 files changed, 27 insertions(+), 59 deletions(-)
diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
index e30eef4..6255ede 100644
--- a/arch/x86/events/intel/rapl.c
+++ b/arch/x86/events/intel/rapl.c
@@ -555,14 +555,14 @@ const struct attribute_group *rapl_attr_groups[] = {
NULL,
};
-static void rapl_cpu_exit(int cpu)
+static int rapl_cpu_offline(unsigned int cpu)
{
struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu);
int target;
/* Check if exiting cpu is used for collecting rapl events */
if (!cpumask_test_and_clear_cpu(cpu, &rapl_cpu_mask))
- return;
+ return 0;
pmu->cpu = -1;
/* Find a new cpu to collect rapl events */
@@ -574,9 +574,10 @@ static void rapl_cpu_exit(int cpu)
pmu->cpu = target;
perf_pmu_migrate_context(pmu->pmu, cpu, target);
}
+ return 0;
}
-static void rapl_cpu_init(int cpu)
+static int rapl_cpu_online(unsigned int cpu)
{
struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu);
int target;
@@ -587,13 +588,14 @@ static void rapl_cpu_init(int cpu)
*/
target = cpumask_any_and(&rapl_cpu_mask, topology_core_cpumask(cpu));
if (target < nr_cpu_ids)
- return;
+ return 0;
cpumask_set_cpu(cpu, &rapl_cpu_mask);
pmu->cpu = cpu;
+ return 0;
}
-static int rapl_cpu_prepare(int cpu)
+static int rapl_cpu_prepare(unsigned int cpu)
{
struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu);
@@ -614,33 +616,6 @@ static int rapl_cpu_prepare(int cpu)
return 0;
}
-static int rapl_cpu_notifier(struct notifier_block *self,
- unsigned long action, void *hcpu)
-{
- unsigned int cpu = (long)hcpu;
-
- switch (action & ~CPU_TASKS_FROZEN) {
- case CPU_UP_PREPARE:
- rapl_cpu_prepare(cpu);
- break;
-
- case CPU_DOWN_FAILED:
- case CPU_ONLINE:
- rapl_cpu_init(cpu);
- break;
-
- case CPU_DOWN_PREPARE:
- rapl_cpu_exit(cpu);
- break;
- }
- return NOTIFY_OK;
-}
-
-static struct notifier_block rapl_cpu_nb = {
- .notifier_call = rapl_cpu_notifier,
- .priority = CPU_PRI_PERF + 1,
-};
-
static int rapl_check_hw_unit(bool apply_quirk)
{
u64 msr_rapl_power_unit_bits;
@@ -691,24 +666,6 @@ static void __init rapl_advertise(void)
}
}
-static int __init rapl_prepare_cpus(void)
-{
- unsigned int cpu, pkg;
- int ret;
-
- for_each_online_cpu(cpu) {
- pkg = topology_logical_package_id(cpu);
- if (rapl_pmus->pmus[pkg])
- continue;
-
- ret = rapl_cpu_prepare(cpu);
- if (ret)
- return ret;
- rapl_cpu_init(cpu);
- }
- return 0;
-}
-
static void cleanup_rapl_pmus(void)
{
int i;
@@ -835,35 +792,44 @@ static int __init rapl_pmu_init(void)
if (ret)
return ret;
- cpu_notifier_register_begin();
+ /*
+ * Install callbacks. Core will call them for each online cpu.
+ */
- ret = rapl_prepare_cpus();
+ ret = cpuhp_setup_state(CPUHP_PERF_X86_RAPL_PREP, "PERF_X86_RAPL_PREP",
+ rapl_cpu_prepare, NULL);
if (ret)
goto out;
+ ret = cpuhp_setup_state(CPUHP_AP_PERF_X86_RAPL_ONLINE,
+ "AP_PERF_X86_RAPL_ONLINE",
+ rapl_cpu_online, rapl_cpu_offline);
+ if (ret)
+ goto out1;
+
ret = perf_pmu_register(&rapl_pmus->pmu, "power", -1);
if (ret)
- goto out;
+ goto out2;
- __register_cpu_notifier(&rapl_cpu_nb);
- cpu_notifier_register_done();
rapl_advertise();
return 0;
+out2:
+ cpuhp_remove_state(CPUHP_AP_PERF_X86_RAPL_ONLINE);
+out1:
+ cpuhp_remove_state(CPUHP_PERF_X86_RAPL_PREP);
out:
pr_warn("Initialization failed (%d), disabled\n", ret);
cleanup_rapl_pmus();
- cpu_notifier_register_done();
return ret;
}
module_init(rapl_pmu_init);
static void __exit intel_rapl_exit(void)
{
- cpu_notifier_register_begin();
- __unregister_cpu_notifier(&rapl_cpu_nb);
+ cpuhp_remove_state_nocalls(CPUHP_AP_PERF_X86_RAPL_ONLINE);
+ cpuhp_remove_state_nocalls(CPUHP_PERF_X86_RAPL_PREP);
perf_pmu_unregister(&rapl_pmus->pmu);
cleanup_rapl_pmus();
- cpu_notifier_register_done();
}
module_exit(intel_rapl_exit);
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 4672019..06d77fd 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -8,6 +8,7 @@ enum cpuhp_state {
CPUHP_PERF_X86_PREPARE,
CPUHP_PERF_X86_UNCORE_PREP,
CPUHP_PERF_X86_AMD_UNCORE_PREP,
+ CPUHP_PERF_X86_RAPL_PREP,
CPUHP_NOTIFY_PREPARE,
CPUHP_BRINGUP_CPU,
CPUHP_AP_IDLE_DEAD,
@@ -34,6 +35,7 @@ enum cpuhp_state {
CPUHP_AP_PERF_X86_ONLINE,
CPUHP_AP_PERF_X86_UNCORE_ONLINE,
CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE,
+ CPUHP_AP_PERF_X86_RAPL_ONLINE,
CPUHP_AP_NOTIFY_ONLINE,
CPUHP_AP_ONLINE_DYN,
CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30,
--
2.8.1
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Richard Cochran <tipbot@zytor.com> |
|---|---|
| Date | 2016-07-19 09:10 +0200 |
| Subject | [tip:smp/hotplug] perf/x86/intel/rapl: Convert to hotplug state machine |
| Message-ID | <rWxke-YG-39@gated-at.bofh.it> |
| In reply to | #1442689 |
Commit-ID: 8b5b773d6245138c461b3a3e242339fa50fa9c58
Gitweb: http://git.kernel.org/tip/8b5b773d6245138c461b3a3e242339fa50fa9c58
Author: Richard Cochran <rcochran@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:15 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 14 Jul 2016 09:34:34 +0200
perf/x86/intel/rapl: Convert to hotplug state machine
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153334.008808086@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/events/intel/rapl.c | 84 +++++++++++++-------------------------------
include/linux/cpuhotplug.h | 2 ++
2 files changed, 27 insertions(+), 59 deletions(-)
diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
index e30eef4..6255ede 100644
--- a/arch/x86/events/intel/rapl.c
+++ b/arch/x86/events/intel/rapl.c
@@ -555,14 +555,14 @@ const struct attribute_group *rapl_attr_groups[] = {
NULL,
};
-static void rapl_cpu_exit(int cpu)
+static int rapl_cpu_offline(unsigned int cpu)
{
struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu);
int target;
/* Check if exiting cpu is used for collecting rapl events */
if (!cpumask_test_and_clear_cpu(cpu, &rapl_cpu_mask))
- return;
+ return 0;
pmu->cpu = -1;
/* Find a new cpu to collect rapl events */
@@ -574,9 +574,10 @@ static void rapl_cpu_exit(int cpu)
pmu->cpu = target;
perf_pmu_migrate_context(pmu->pmu, cpu, target);
}
+ return 0;
}
-static void rapl_cpu_init(int cpu)
+static int rapl_cpu_online(unsigned int cpu)
{
struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu);
int target;
@@ -587,13 +588,14 @@ static void rapl_cpu_init(int cpu)
*/
target = cpumask_any_and(&rapl_cpu_mask, topology_core_cpumask(cpu));
if (target < nr_cpu_ids)
- return;
+ return 0;
cpumask_set_cpu(cpu, &rapl_cpu_mask);
pmu->cpu = cpu;
+ return 0;
}
-static int rapl_cpu_prepare(int cpu)
+static int rapl_cpu_prepare(unsigned int cpu)
{
struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu);
@@ -614,33 +616,6 @@ static int rapl_cpu_prepare(int cpu)
return 0;
}
-static int rapl_cpu_notifier(struct notifier_block *self,
- unsigned long action, void *hcpu)
-{
- unsigned int cpu = (long)hcpu;
-
- switch (action & ~CPU_TASKS_FROZEN) {
- case CPU_UP_PREPARE:
- rapl_cpu_prepare(cpu);
- break;
-
- case CPU_DOWN_FAILED:
- case CPU_ONLINE:
- rapl_cpu_init(cpu);
- break;
-
- case CPU_DOWN_PREPARE:
- rapl_cpu_exit(cpu);
- break;
- }
- return NOTIFY_OK;
-}
-
-static struct notifier_block rapl_cpu_nb = {
- .notifier_call = rapl_cpu_notifier,
- .priority = CPU_PRI_PERF + 1,
-};
-
static int rapl_check_hw_unit(bool apply_quirk)
{
u64 msr_rapl_power_unit_bits;
@@ -691,24 +666,6 @@ static void __init rapl_advertise(void)
}
}
-static int __init rapl_prepare_cpus(void)
-{
- unsigned int cpu, pkg;
- int ret;
-
- for_each_online_cpu(cpu) {
- pkg = topology_logical_package_id(cpu);
- if (rapl_pmus->pmus[pkg])
- continue;
-
- ret = rapl_cpu_prepare(cpu);
- if (ret)
- return ret;
- rapl_cpu_init(cpu);
- }
- return 0;
-}
-
static void cleanup_rapl_pmus(void)
{
int i;
@@ -835,35 +792,44 @@ static int __init rapl_pmu_init(void)
if (ret)
return ret;
- cpu_notifier_register_begin();
+ /*
+ * Install callbacks. Core will call them for each online cpu.
+ */
- ret = rapl_prepare_cpus();
+ ret = cpuhp_setup_state(CPUHP_PERF_X86_RAPL_PREP, "PERF_X86_RAPL_PREP",
+ rapl_cpu_prepare, NULL);
if (ret)
goto out;
+ ret = cpuhp_setup_state(CPUHP_AP_PERF_X86_RAPL_ONLINE,
+ "AP_PERF_X86_RAPL_ONLINE",
+ rapl_cpu_online, rapl_cpu_offline);
+ if (ret)
+ goto out1;
+
ret = perf_pmu_register(&rapl_pmus->pmu, "power", -1);
if (ret)
- goto out;
+ goto out2;
- __register_cpu_notifier(&rapl_cpu_nb);
- cpu_notifier_register_done();
rapl_advertise();
return 0;
+out2:
+ cpuhp_remove_state(CPUHP_AP_PERF_X86_RAPL_ONLINE);
+out1:
+ cpuhp_remove_state(CPUHP_PERF_X86_RAPL_PREP);
out:
pr_warn("Initialization failed (%d), disabled\n", ret);
cleanup_rapl_pmus();
- cpu_notifier_register_done();
return ret;
}
module_init(rapl_pmu_init);
static void __exit intel_rapl_exit(void)
{
- cpu_notifier_register_begin();
- __unregister_cpu_notifier(&rapl_cpu_nb);
+ cpuhp_remove_state_nocalls(CPUHP_AP_PERF_X86_RAPL_ONLINE);
+ cpuhp_remove_state_nocalls(CPUHP_PERF_X86_RAPL_PREP);
perf_pmu_unregister(&rapl_pmus->pmu);
cleanup_rapl_pmus();
- cpu_notifier_register_done();
}
module_exit(intel_rapl_exit);
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 4672019..06d77fd 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -8,6 +8,7 @@ enum cpuhp_state {
CPUHP_PERF_X86_PREPARE,
CPUHP_PERF_X86_UNCORE_PREP,
CPUHP_PERF_X86_AMD_UNCORE_PREP,
+ CPUHP_PERF_X86_RAPL_PREP,
CPUHP_NOTIFY_PREPARE,
CPUHP_BRINGUP_CPU,
CPUHP_AP_IDLE_DEAD,
@@ -34,6 +35,7 @@ enum cpuhp_state {
CPUHP_AP_PERF_X86_ONLINE,
CPUHP_AP_PERF_X86_UNCORE_ONLINE,
CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE,
+ CPUHP_AP_PERF_X86_RAPL_ONLINE,
CPUHP_AP_NOTIFY_ONLINE,
CPUHP_AP_ONLINE_DYN,
CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30,
[toc] | [prev] | [next] | [standalone]
| From | Anna-Maria Gleixner <anna-maria@linutronix.de> |
|---|---|
| Date | 2016-07-13 19:40 +0200 |
| Subject | [patch V2 01/67] cpuhotplug: Handle early registration gracefully |
| Message-ID | <rUwiC-6ch-5@gated-at.bofh.it> |
| In reply to | #1442667 |
From: Thomas Gleixner <tglx@linutronix.de> We switched the hotplug machinery to smpboot threads. Early registration of hotplug callbacks, i.e. from do_pre_smp_initcalls(), happens before the threads are initialized. Instead of moving the thread init, we simply handle it in the hotplug code itself and invoke the function directly. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> --- kernel/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -517,6 +517,13 @@ static int cpuhp_invoke_ap_callback(int if (!cpu_online(cpu)) return 0; + /* + * If we are up and running, use the hotplug thread. For early calls + * we invoke the thread function directly. + */ + if (!st->thread) + return cpuhp_invoke_callback(cpu, state, cb); + st->cb_state = state; st->cb = cb; /*
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Thomas Gleixner <tipbot@zytor.com> |
|---|---|
| Date | 2016-07-19 09:00 +0200 |
| Subject | [tip:smp/hotplug] cpu/hotplug: Handle early registration gracefully |
| Message-ID | <rWxay-FB-41@gated-at.bofh.it> |
| In reply to | #1442691 |
Commit-ID: 6a4e24518c8a10f78f44da219835239cb5aca90d Gitweb: http://git.kernel.org/tip/6a4e24518c8a10f78f44da219835239cb5aca90d Author: Thomas Gleixner <tglx@linutronix.de> AuthorDate: Wed, 13 Jul 2016 17:16:03 +0000 Committer: Ingo Molnar <mingo@kernel.org> CommitDate: Thu, 14 Jul 2016 09:34:25 +0200 cpu/hotplug: Handle early registration gracefully We switched the hotplug machinery to smpboot threads. Early registration of hotplug callbacks, i.e. from do_pre_smp_initcalls(), happens before the threads are initialized. Instead of moving the thread init, we simply handle it in the hotplug code itself and invoke the function directly. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160713153332.896450738@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org> --- kernel/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/cpu.c b/kernel/cpu.c index 7b61887..fe71ce4 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -517,6 +517,13 @@ static int cpuhp_invoke_ap_callback(int cpu, enum cpuhp_state state, if (!cpu_online(cpu)) return 0; + /* + * If we are up and running, use the hotplug thread. For early calls + * we invoke the thread function directly. + */ + if (!st->thread) + return cpuhp_invoke_callback(cpu, state, cb); + st->cb_state = state; st->cb = cb; /*
[toc] | [prev] | [next] | [standalone]
| From | Anna-Maria Gleixner <anna-maria@linutronix.de> |
|---|---|
| Date | 2016-07-13 19:40 +0200 |
| Subject | [patch V2 32/67] x86/kvm/kvmclock: Convert to hotplug state machine |
| Message-ID | <rUwiC-6ch-7@gated-at.bofh.it> |
| In reply to | #1442667 |
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
We assumed that the priority ordering was ment to invoke the online
callback as the last step. In the original code this also invoked the
down prepare callback as the last step. With the symmetric state
machine the down prepare callback is now the first step.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Radim Krcmar <rkrcmar@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kvm@vger.kernel.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
arch/x86/kvm/x86.c | 33 ++++++++-------------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 9 insertions(+), 25 deletions(-)
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5552,9 +5552,10 @@ int kvm_fast_pio_out(struct kvm_vcpu *vc
}
EXPORT_SYMBOL_GPL(kvm_fast_pio_out);
-static void tsc_bad(void *info)
+static int kvmclock_cpu_down_prep(unsigned int cpu)
{
__this_cpu_write(cpu_tsc_khz, 0);
+ return 0;
}
static void tsc_khz_changed(void *data)
@@ -5659,33 +5660,18 @@ static struct notifier_block kvmclock_cp
.notifier_call = kvmclock_cpufreq_notifier
};
-static int kvmclock_cpu_notifier(struct notifier_block *nfb,
- unsigned long action, void *hcpu)
+static int kvmclock_cpu_online(unsigned int cpu)
{
- switch (action) {
- case CPU_ONLINE:
- case CPU_DOWN_FAILED:
- tsc_khz_changed(NULL);
- break;
- case CPU_DOWN_PREPARE:
- tsc_bad(NULL);
- break;
- }
- return NOTIFY_OK;
+ tsc_khz_changed(NULL);
+ return 0;
}
-static struct notifier_block kvmclock_cpu_notifier_block = {
- .notifier_call = kvmclock_cpu_notifier,
- .priority = -INT_MAX
-};
-
static void kvm_timer_init(void)
{
int cpu;
max_tsc_khz = tsc_khz;
- cpu_notifier_register_begin();
if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
#ifdef CONFIG_CPU_FREQ
struct cpufreq_policy policy;
@@ -5700,12 +5686,9 @@ static void kvm_timer_init(void)
CPUFREQ_TRANSITION_NOTIFIER);
}
pr_debug("kvm: max_tsc_khz = %ld\n", max_tsc_khz);
- for_each_online_cpu(cpu)
- smp_call_function_single(cpu, tsc_khz_changed, NULL, 1);
-
- __register_hotcpu_notifier(&kvmclock_cpu_notifier_block);
- cpu_notifier_register_done();
+ cpuhp_setup_state(CPUHP_AP_X86_KVM_CLK_ONLINE, "AP_X86_KVM_CLK_ONLINE",
+ kvmclock_cpu_online, kvmclock_cpu_down_prep);
}
static DEFINE_PER_CPU(struct kvm_vcpu *, current_vcpu);
@@ -5894,7 +5877,7 @@ void kvm_arch_exit(void)
if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
cpufreq_unregister_notifier(&kvmclock_cpufreq_notifier_block,
CPUFREQ_TRANSITION_NOTIFIER);
- unregister_hotcpu_notifier(&kvmclock_cpu_notifier_block);
+ cpuhp_remove_state_nocalls(CPUHP_AP_X86_KVM_CLK_ONLINE);
#ifdef CONFIG_X86_64
pvclock_gtod_unregister_notifier(&pvclock_gtod_notifier);
#endif
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -57,6 +57,7 @@ enum cpuhp_state {
CPUHP_AP_ONLINE_DYN,
CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30,
CPUHP_AP_X86_HPET_ONLINE,
+ CPUHP_AP_X86_KVM_CLK_ONLINE,
CPUHP_AP_ACTIVE,
CPUHP_ONLINE,
};
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> |
|---|---|
| Date | 2016-07-19 09:20 +0200 |
| Subject | [tip:smp/hotplug] x86/kvm/kvmclock: Convert to hotplug state machine |
| Message-ID | <rWxtU-129-9@gated-at.bofh.it> |
| In reply to | #1442692 |
Commit-ID: 251a5fd64b720a0646eddb8c54f5e9ddba066e72
Gitweb: http://git.kernel.org/tip/251a5fd64b720a0646eddb8c54f5e9ddba066e72
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:33 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:40:21 +0200
x86/kvm/kvmclock: Convert to hotplug state machine
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
We assumed that the priority ordering was ment to invoke the online
callback as the last step. In the original code this also invoked the
down prepare callback as the last step. With the symmetric state
machine the down prepare callback is now the first step.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Radim Krcmar <rkrcmar@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kvm@vger.kernel.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153335.542880859@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kvm/x86.c | 33 ++++++++-------------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 9 insertions(+), 25 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6f90595..f899127 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5552,9 +5552,10 @@ int kvm_fast_pio_out(struct kvm_vcpu *vcpu, int size, unsigned short port)
}
EXPORT_SYMBOL_GPL(kvm_fast_pio_out);
-static void tsc_bad(void *info)
+static int kvmclock_cpu_down_prep(unsigned int cpu)
{
__this_cpu_write(cpu_tsc_khz, 0);
+ return 0;
}
static void tsc_khz_changed(void *data)
@@ -5659,33 +5660,18 @@ static struct notifier_block kvmclock_cpufreq_notifier_block = {
.notifier_call = kvmclock_cpufreq_notifier
};
-static int kvmclock_cpu_notifier(struct notifier_block *nfb,
- unsigned long action, void *hcpu)
+static int kvmclock_cpu_online(unsigned int cpu)
{
- switch (action) {
- case CPU_ONLINE:
- case CPU_DOWN_FAILED:
- tsc_khz_changed(NULL);
- break;
- case CPU_DOWN_PREPARE:
- tsc_bad(NULL);
- break;
- }
- return NOTIFY_OK;
+ tsc_khz_changed(NULL);
+ return 0;
}
-static struct notifier_block kvmclock_cpu_notifier_block = {
- .notifier_call = kvmclock_cpu_notifier,
- .priority = -INT_MAX
-};
-
static void kvm_timer_init(void)
{
int cpu;
max_tsc_khz = tsc_khz;
- cpu_notifier_register_begin();
if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
#ifdef CONFIG_CPU_FREQ
struct cpufreq_policy policy;
@@ -5700,12 +5686,9 @@ static void kvm_timer_init(void)
CPUFREQ_TRANSITION_NOTIFIER);
}
pr_debug("kvm: max_tsc_khz = %ld\n", max_tsc_khz);
- for_each_online_cpu(cpu)
- smp_call_function_single(cpu, tsc_khz_changed, NULL, 1);
-
- __register_hotcpu_notifier(&kvmclock_cpu_notifier_block);
- cpu_notifier_register_done();
+ cpuhp_setup_state(CPUHP_AP_X86_KVM_CLK_ONLINE, "AP_X86_KVM_CLK_ONLINE",
+ kvmclock_cpu_online, kvmclock_cpu_down_prep);
}
static DEFINE_PER_CPU(struct kvm_vcpu *, current_vcpu);
@@ -5894,7 +5877,7 @@ void kvm_arch_exit(void)
if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
cpufreq_unregister_notifier(&kvmclock_cpufreq_notifier_block,
CPUFREQ_TRANSITION_NOTIFIER);
- unregister_hotcpu_notifier(&kvmclock_cpu_notifier_block);
+ cpuhp_remove_state_nocalls(CPUHP_AP_X86_KVM_CLK_ONLINE);
#ifdef CONFIG_X86_64
pvclock_gtod_unregister_notifier(&pvclock_gtod_notifier);
#endif
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 7449081..8c190a8 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -56,6 +56,7 @@ enum cpuhp_state {
CPUHP_AP_ONLINE_DYN,
CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30,
CPUHP_AP_X86_HPET_ONLINE,
+ CPUHP_AP_X86_KVM_CLK_ONLINE,
CPUHP_AP_ACTIVE,
CPUHP_ONLINE,
};
[toc] | [prev] | [next] | [standalone]
| From | Anna-Maria Gleixner <anna-maria@linutronix.de> |
|---|---|
| Date | 2016-07-13 19:40 +0200 |
| Subject | [patch V2 07/67] irqchip/bcm2836: Convert to hotplug state machine |
| Message-ID | <rUwiC-6ch-9@gated-at.bofh.it> |
| In reply to | #1442667 |
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Install the callbacks via the state machine.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
drivers/irqchip/irq-bcm2836.c | 34 +++++++++++++---------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c
index 72ff1d5..f2575cb 100644
--- a/drivers/irqchip/irq-bcm2836.c
+++ b/drivers/irqchip/irq-bcm2836.c
@@ -202,26 +202,19 @@ static void bcm2836_arm_irqchip_send_ipi(const struct cpumask *mask,
}
}
-/* Unmasks the IPI on the CPU when it's online. */
-static int bcm2836_arm_irqchip_cpu_notify(struct notifier_block *nfb,
- unsigned long action, void *hcpu)
+static int bcm2836_cpu_starting(unsigned int cpu)
{
- unsigned int cpu = (unsigned long)hcpu;
- unsigned int int_reg = LOCAL_MAILBOX_INT_CONTROL0;
- unsigned int mailbox = 0;
-
- if (action == CPU_STARTING || action == CPU_STARTING_FROZEN)
- bcm2836_arm_irqchip_unmask_per_cpu_irq(int_reg, mailbox, cpu);
- else if (action == CPU_DYING)
- bcm2836_arm_irqchip_mask_per_cpu_irq(int_reg, mailbox, cpu);
-
- return NOTIFY_OK;
+ bcm2836_arm_irqchip_unmask_per_cpu_irq(LOCAL_MAILBOX_INT_CONTROL0, 0,
+ cpu);
+ return 0;
}
-static struct notifier_block bcm2836_arm_irqchip_cpu_notifier = {
- .notifier_call = bcm2836_arm_irqchip_cpu_notify,
- .priority = 100,
-};
+static int bcm2836_cpu_dying(unsigned int cpu)
+{
+ bcm2836_arm_irqchip_mask_per_cpu_irq(LOCAL_MAILBOX_INT_CONTROL0, 0,
+ cpu);
+ return 0;
+}
#ifdef CONFIG_ARM
int __init bcm2836_smp_boot_secondary(unsigned int cpu,
@@ -251,10 +244,9 @@ bcm2836_arm_irqchip_smp_init(void)
{
#ifdef CONFIG_SMP
/* Unmask IPIs to the boot CPU. */
- bcm2836_arm_irqchip_cpu_notify(&bcm2836_arm_irqchip_cpu_notifier,
- CPU_STARTING,
- (void *)(uintptr_t)smp_processor_id());
- register_cpu_notifier(&bcm2836_arm_irqchip_cpu_notifier);
+ cpuhp_setup_state(CPUHP_AP_IRQ_BCM2836_STARTING,
+ "AP_IRQ_BCM2836_STARTING", bcm2836_cpu_starting,
+ bcm2836_cpu_dying);
set_smp_cross_call(bcm2836_arm_irqchip_send_ipi);
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 3a08ab9..420cfcf 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -14,6 +14,7 @@ enum cpuhp_state {
CPUHP_AP_IRQ_HIP04_STARTING,
CPUHP_AP_IRQ_ARMADA_XP_STARTING,
CPUHP_AP_IRQ_ARMADA_CASC_STARTING,
+ CPUHP_AP_IRQ_BCM2836_STARTING,
CPUHP_AP_NOTIFY_STARTING,
CPUHP_AP_ONLINE,
CPUHP_TEARDOWN_CPU,
--
2.8.1
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> |
|---|---|
| Date | 2016-07-19 09:10 +0200 |
| Subject | [tip:smp/hotplug] irqchip/bcm2836: Convert to hotplug state machine |
| Message-ID | <rWxkf-YG-71@gated-at.bofh.it> |
| In reply to | #1442693 |
Commit-ID: 7ca04bc277431a271061dd85f98b6da4171ad2e4
Gitweb: http://git.kernel.org/tip/7ca04bc277431a271061dd85f98b6da4171ad2e4
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:07 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 14 Jul 2016 09:34:30 +0200
irqchip/bcm2836: Convert to hotplug state machine
Install the callbacks via the state machine.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153333.416260485@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
drivers/irqchip/irq-bcm2836.c | 34 +++++++++++++---------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c
index 72ff1d5..f2575cb 100644
--- a/drivers/irqchip/irq-bcm2836.c
+++ b/drivers/irqchip/irq-bcm2836.c
@@ -202,26 +202,19 @@ static void bcm2836_arm_irqchip_send_ipi(const struct cpumask *mask,
}
}
-/* Unmasks the IPI on the CPU when it's online. */
-static int bcm2836_arm_irqchip_cpu_notify(struct notifier_block *nfb,
- unsigned long action, void *hcpu)
+static int bcm2836_cpu_starting(unsigned int cpu)
{
- unsigned int cpu = (unsigned long)hcpu;
- unsigned int int_reg = LOCAL_MAILBOX_INT_CONTROL0;
- unsigned int mailbox = 0;
-
- if (action == CPU_STARTING || action == CPU_STARTING_FROZEN)
- bcm2836_arm_irqchip_unmask_per_cpu_irq(int_reg, mailbox, cpu);
- else if (action == CPU_DYING)
- bcm2836_arm_irqchip_mask_per_cpu_irq(int_reg, mailbox, cpu);
-
- return NOTIFY_OK;
+ bcm2836_arm_irqchip_unmask_per_cpu_irq(LOCAL_MAILBOX_INT_CONTROL0, 0,
+ cpu);
+ return 0;
}
-static struct notifier_block bcm2836_arm_irqchip_cpu_notifier = {
- .notifier_call = bcm2836_arm_irqchip_cpu_notify,
- .priority = 100,
-};
+static int bcm2836_cpu_dying(unsigned int cpu)
+{
+ bcm2836_arm_irqchip_mask_per_cpu_irq(LOCAL_MAILBOX_INT_CONTROL0, 0,
+ cpu);
+ return 0;
+}
#ifdef CONFIG_ARM
int __init bcm2836_smp_boot_secondary(unsigned int cpu,
@@ -251,10 +244,9 @@ bcm2836_arm_irqchip_smp_init(void)
{
#ifdef CONFIG_SMP
/* Unmask IPIs to the boot CPU. */
- bcm2836_arm_irqchip_cpu_notify(&bcm2836_arm_irqchip_cpu_notifier,
- CPU_STARTING,
- (void *)(uintptr_t)smp_processor_id());
- register_cpu_notifier(&bcm2836_arm_irqchip_cpu_notifier);
+ cpuhp_setup_state(CPUHP_AP_IRQ_BCM2836_STARTING,
+ "AP_IRQ_BCM2836_STARTING", bcm2836_cpu_starting,
+ bcm2836_cpu_dying);
set_smp_cross_call(bcm2836_arm_irqchip_send_ipi);
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 3a08ab9..420cfcf 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -14,6 +14,7 @@ enum cpuhp_state {
CPUHP_AP_IRQ_HIP04_STARTING,
CPUHP_AP_IRQ_ARMADA_XP_STARTING,
CPUHP_AP_IRQ_ARMADA_CASC_STARTING,
+ CPUHP_AP_IRQ_BCM2836_STARTING,
CPUHP_AP_NOTIFY_STARTING,
CPUHP_AP_ONLINE,
CPUHP_TEARDOWN_CPU,
[toc] | [prev] | [next] | [standalone]
| From | Anna-Maria Gleixner <anna-maria@linutronix.de> |
|---|---|
| Date | 2016-07-13 19:40 +0200 |
| Subject | [patch V2 18/67] powerpc/perf: Convert book3s notifier to state machine callbacks |
| Message-ID | <rUwiC-6ch-15@gated-at.bofh.it> |
| In reply to | #1442667 |
From: Thomas Gleixner <tglx@linutronix.de>
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
arch/powerpc/perf/core-book3s.c | 30 +++++++-----------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 8 insertions(+), 23 deletions(-)
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 97a1d40..ffd61d5 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -2158,31 +2158,15 @@ static void perf_event_interrupt(struct pt_regs *regs)
irq_exit();
}
-static void power_pmu_setup(int cpu)
+int power_pmu_prepare_cpu(unsigned int cpu)
{
struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
- if (!ppmu)
- return;
- memset(cpuhw, 0, sizeof(*cpuhw));
- cpuhw->mmcr[0] = MMCR0_FC;
-}
-
-static int
-power_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
-{
- unsigned int cpu = (long)hcpu;
-
- switch (action & ~CPU_TASKS_FROZEN) {
- case CPU_UP_PREPARE:
- power_pmu_setup(cpu);
- break;
-
- default:
- break;
+ if (ppmu) {
+ memset(cpuhw, 0, sizeof(*cpuhw));
+ cpuhw->mmcr[0] = MMCR0_FC;
}
-
- return NOTIFY_OK;
+ return 0;
}
int register_power_pmu(struct power_pmu *pmu)
@@ -2205,7 +2189,7 @@ int register_power_pmu(struct power_pmu *pmu)
#endif /* CONFIG_PPC64 */
perf_pmu_register(&power_pmu, "cpu", PERF_TYPE_RAW);
- perf_cpu_notifier(power_pmu_notifier);
-
+ cpuhp_setup_state(CPUHP_PERF_POWER, "PERF_POWER",
+ power_pmu_prepare_cpu, NULL);
return 0;
}
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index d54973e..b265e99 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -10,6 +10,7 @@ enum cpuhp_state {
CPUHP_PERF_X86_AMD_UNCORE_PREP,
CPUHP_PERF_X86_RAPL_PREP,
CPUHP_PERF_BFIN,
+ CPUHP_PERF_POWER,
CPUHP_NOTIFY_PREPARE,
CPUHP_BRINGUP_CPU,
CPUHP_AP_IDLE_DEAD,
--
2.8.1
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Thomas Gleixner <tipbot@zytor.com> |
|---|---|
| Date | 2016-07-19 09:10 +0200 |
| Subject | [tip:smp/hotplug] powerpc/perf: Convert book3s notifier to state machine callbacks |
| Message-ID | <rWxkd-YG-19@gated-at.bofh.it> |
| In reply to | #1442694 |
Commit-ID: 57ecde42cc7493fb74029918d0a8f97aec854876
Gitweb: http://git.kernel.org/tip/57ecde42cc7493fb74029918d0a8f97aec854876
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:20 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 14 Jul 2016 09:34:37 +0200
powerpc/perf: Convert book3s notifier to state machine callbacks
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153334.345786236@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/powerpc/perf/core-book3s.c | 30 +++++++-----------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 8 insertions(+), 23 deletions(-)
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 97a1d40..ffd61d5 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -2158,31 +2158,15 @@ static void perf_event_interrupt(struct pt_regs *regs)
irq_exit();
}
-static void power_pmu_setup(int cpu)
+int power_pmu_prepare_cpu(unsigned int cpu)
{
struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
- if (!ppmu)
- return;
- memset(cpuhw, 0, sizeof(*cpuhw));
- cpuhw->mmcr[0] = MMCR0_FC;
-}
-
-static int
-power_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
-{
- unsigned int cpu = (long)hcpu;
-
- switch (action & ~CPU_TASKS_FROZEN) {
- case CPU_UP_PREPARE:
- power_pmu_setup(cpu);
- break;
-
- default:
- break;
+ if (ppmu) {
+ memset(cpuhw, 0, sizeof(*cpuhw));
+ cpuhw->mmcr[0] = MMCR0_FC;
}
-
- return NOTIFY_OK;
+ return 0;
}
int register_power_pmu(struct power_pmu *pmu)
@@ -2205,7 +2189,7 @@ int register_power_pmu(struct power_pmu *pmu)
#endif /* CONFIG_PPC64 */
perf_pmu_register(&power_pmu, "cpu", PERF_TYPE_RAW);
- perf_cpu_notifier(power_pmu_notifier);
-
+ cpuhp_setup_state(CPUHP_PERF_POWER, "PERF_POWER",
+ power_pmu_prepare_cpu, NULL);
return 0;
}
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index d54973e..b265e99 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -10,6 +10,7 @@ enum cpuhp_state {
CPUHP_PERF_X86_AMD_UNCORE_PREP,
CPUHP_PERF_X86_RAPL_PREP,
CPUHP_PERF_BFIN,
+ CPUHP_PERF_POWER,
CPUHP_NOTIFY_PREPARE,
CPUHP_BRINGUP_CPU,
CPUHP_AP_IDLE_DEAD,
[toc] | [prev] | [next] | [standalone]
Page 3 of 6 — ← Prev page 1 2 [3] 4 5 6 Next page →
Back to top | Article view | linux.kernel
csiph-web