* [RFC PATCH v1 01/70] cpu: Restructure FROZEN state handling [not found] <1406020218-6657-1-git-send-email-gong.chen@linux.intel.com> @ 2014-07-22 9:09 ` Chen, Gong 0 siblings, 0 replies; 3+ messages in thread From: Chen, Gong @ 2014-07-22 9:09 UTC (permalink / raw) To: linux-kernel Cc: mingo, tglx, paulus, benh, tony.luck, hpa, jkosina, rafael.j.wysocki, bp, linux, ralf, schwidefsky, davem, viro, fweisbec, cl, akpm, axboe, JBottomley, neilb, christoffer.dall, rostedt, rric, gregkh, mhocko, david From: Thomas Gleixner <tglx@linutronix.de> There are only a few callbacks which really care about FROZEN vs. !FROZEN. No need to have extra states for this. Publish the frozen state in an extra variable which is updated under the hotplug lock and let the users interested deal with it w/o imposing that extra state checks on everyone. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- kernel/cpu.c | 66 +++++++++++++++++++++++++----------------------------------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index a343bde..3da7e82 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -27,6 +27,7 @@ #ifdef CONFIG_SMP /* Serializes the updates to cpu_online_mask, cpu_present_mask */ static DEFINE_MUTEX(cpu_add_remove_lock); +static bool cpuhp_tasks_frozen; /* * The following two APIs (cpu_maps_update_begin/done) must be used when @@ -194,27 +195,30 @@ int __ref __register_cpu_notifier(struct notifier_block *nb) return raw_notifier_chain_register(&cpu_chain, nb); } -static int __cpu_notify(unsigned long val, void *v, int nr_to_call, +static int __cpu_notify(unsigned long val, unsigned int cpu, int nr_to_call, int *nr_calls) { + unsigned long mod = cpuhp_tasks_frozen ? CPU_TASKS_FROZEN : 0; + void *hcpu = (void *)(long)cpu; + int ret; - ret = __raw_notifier_call_chain(&cpu_chain, val, v, nr_to_call, + ret = __raw_notifier_call_chain(&cpu_chain, val | mod, hcpu, nr_to_call, nr_calls); return notifier_to_errno(ret); } -static int cpu_notify(unsigned long val, void *v) +static int cpu_notify(unsigned long val, unsigned int cpu) { - return __cpu_notify(val, v, -1, NULL); + return __cpu_notify(val, cpu, -1, NULL); } #ifdef CONFIG_HOTPLUG_CPU -static void cpu_notify_nofail(unsigned long val, void *v) +static void cpu_notify_nofail(unsigned long val, unsigned int cpu) { - BUG_ON(cpu_notify(val, v)); + BUG_ON(cpu_notify(val, cpu)); } EXPORT_SYMBOL(register_cpu_notifier); EXPORT_SYMBOL(__register_cpu_notifier); @@ -291,23 +295,17 @@ static inline void check_for_tasks(int cpu) write_unlock_irq(&tasklist_lock); } -struct take_cpu_down_param { - unsigned long mod; - void *hcpu; -}; - /* Take this CPU down. */ static int __ref take_cpu_down(void *_param) { - struct take_cpu_down_param *param = _param; - int err; + int err, cpu = smp_processor_id(); /* Ensure this CPU doesn't handle any more interrupts. */ err = __cpu_disable(); if (err < 0) return err; - cpu_notify(CPU_DYING | param->mod, param->hcpu); + cpu_notify(CPU_DYING, cpu); /* Park the stopper thread */ kthread_park(current); return 0; @@ -317,12 +315,6 @@ static int __ref take_cpu_down(void *_param) static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) { int err, nr_calls = 0; - void *hcpu = (void *)(long)cpu; - unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0; - struct take_cpu_down_param tcd_param = { - .mod = mod, - .hcpu = hcpu, - }; if (num_online_cpus() == 1) return -EBUSY; @@ -332,10 +324,12 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) cpu_hotplug_begin(); - err = __cpu_notify(CPU_DOWN_PREPARE | mod, hcpu, -1, &nr_calls); + cpuhp_tasks_frozen = tasks_frozen; + + err = __cpu_notify(CPU_DOWN_PREPARE, cpu, -1, &nr_calls); if (err) { nr_calls--; - __cpu_notify(CPU_DOWN_FAILED | mod, hcpu, nr_calls, NULL); + __cpu_notify(CPU_DOWN_FAILED, cpu, nr_calls, NULL); pr_warn("%s: attempt to take down CPU %u failed\n", __func__, cpu); goto out_release; @@ -362,11 +356,11 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) * So now all preempt/rcu users must observe !cpu_active(). */ - err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu)); + err = __stop_machine(take_cpu_down, NULL, cpumask_of(cpu)); if (err) { /* CPU didn't die: tell everyone. Can't complain. */ smpboot_unpark_threads(cpu); - cpu_notify_nofail(CPU_DOWN_FAILED | mod, hcpu); + cpu_notify_nofail(CPU_DOWN_FAILED, cpu); goto out_release; } BUG_ON(cpu_online(cpu)); @@ -385,14 +379,14 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) __cpu_die(cpu); /* CPU is completely dead: tell everyone. Too late to complain. */ - cpu_notify_nofail(CPU_DEAD | mod, hcpu); + cpu_notify_nofail(CPU_DEAD, cpu); check_for_tasks(cpu); out_release: cpu_hotplug_done(); if (!err) - cpu_notify_nofail(CPU_POST_DEAD | mod, hcpu); + cpu_notify_nofail(CPU_POST_DEAD, cpu); return err; } @@ -419,10 +413,8 @@ EXPORT_SYMBOL(cpu_down); /* Requires cpu_add_remove_lock to be held */ static int _cpu_up(unsigned int cpu, int tasks_frozen) { - int ret, nr_calls = 0; - void *hcpu = (void *)(long)cpu; - unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0; struct task_struct *idle; + int ret, nr_calls = 0; cpu_hotplug_begin(); @@ -441,7 +433,9 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen) if (ret) goto out; - ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls); + cpuhp_tasks_frozen = tasks_frozen; + + ret = __cpu_notify(CPU_UP_PREPARE, cpu, -1, &nr_calls); if (ret) { nr_calls--; pr_warn("%s: attempt to bring up CPU %u failed\n", @@ -459,11 +453,11 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen) smpboot_unpark_threads(cpu); /* Now call notifier in preparation. */ - cpu_notify(CPU_ONLINE | mod, hcpu); + cpu_notify(CPU_ONLINE, cpu); out_notify: if (ret != 0) - __cpu_notify(CPU_UP_CANCELED | mod, hcpu, nr_calls, NULL); + __cpu_notify(CPU_UP_CANCELED, cpu, nr_calls, NULL); out: cpu_hotplug_done(); @@ -650,13 +644,7 @@ core_initcall(cpu_hotplug_pm_sync_init); */ void notify_cpu_starting(unsigned int cpu) { - unsigned long val = CPU_STARTING; - -#ifdef CONFIG_PM_SLEEP_SMP - if (frozen_cpus != NULL && cpumask_test_cpu(cpu, frozen_cpus)) - val = CPU_STARTING_FROZEN; -#endif /* CONFIG_PM_SLEEP_SMP */ - cpu_notify(val, (void *)(long)cpu); + cpu_notify(CPU_STARTING, cpu); } #endif /* CONFIG_SMP */ -- 2.0.0.rc2 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [RESEND RFC PATCH v1 0/70] Gloabl CPU Hot-plug flag _FROZEN Clean up
@ 2014-07-23 1:58 Chen, Gong
2014-07-23 1:58 ` [RFC PATCH v1 01/70] cpu: Restructure FROZEN state handling Chen, Gong
0 siblings, 1 reply; 3+ messages in thread
From: Chen, Gong @ 2014-07-23 1:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, tglx, paulus, benh, tony.luck, hpa, jkosina,
rafael.j.wysocki, bp, linux, ralf, schwidefsky, davem, viro,
fweisbec, cl, akpm, axboe, JBottomley, neilb, christoffer.dall,
rostedt, rric, gregkh, mhocko, david
Back to long time ago (about 1.5 years), Thomas began the work
for CPU hot-plug, one first thing is CPU hotplug flag cleanup.
Paul hoped all the _FROZEN variants of the notifier actions
can be removed at that time. Now here it is.
Patch 1 ~ 69: remove all kinds of XXX_FROZEN usages
Patch 70: remove XXX_FROZEN from the kernel thoroughly
Not sure if removing XXX_FROZEN flags thoroughly is overkilled.
Fix me if I'm wrong.
P.S. My last post is banned because of the capital Triple-X in subject :-(
----------------------------------------------------------------
Chen, Gong (69):
ia64, err_inject: _FROZEN Cleanup
ia64, mca: _FROZEN Cleanup
ia64, palinfo: _FROZEN Cleanup
ia64, salinfo: _FROZEN Cleanup
ia64, topology: _FROZEN Cleanup
x86, intel_cacheinfo: _FROZEN Cleanup
x86, mce, therm_throt: _FROZEN Cleanup
x86, mce_amd: _FROZEN Cleanup
x86, kvm: _FROZEN Cleanup
x86, vsyscall_64: _FROZEN Cleanup
x86, pci, amd_bus: _FROZEN Cleanup
x86, x2apic_cluster: _FROZEN Cleanup
x86, microcode, core: _FROZEN Cleanup
x86, kernel, cpuid: _FROZEN Cleanup
x86, kernel, msr: _FROZEN Cleanup
arm, vfp, vfpmodule: _FROZEN Cleanup
arm, kvm: _FROZEN Cleanup
powerpc, sysfs: _FROZEN Cleanup
powerpc, mm, numa: _FROZEN Cleanup
powerpc, powermac, smp: _FROZEN Cleanup
powerpc, mmu_context_nohash: _FROZEN Cleanup
mips, loongson, smp: _FROZEN Cleanup
s390, perf_cpum_sf: _FROZEN Cleanup
sparc, sysfs: _FROZEN Cleanup
rcu, tree: _FROZEN Cleanup
kernel, padata: _FROZEN Cleanup
kernel, profile: _FROZEN Cleanup
kernel, sched, core: _FROZEN Cleanup
kernel, hrtimer: _FROZEN Cleanup
kernel, relay: _FROZEN Cleanup
kernel, smp: _FROZEN Cleanup
kernel, timer: _FROZEN Cleanup
kernel, softirq: _FROZEN Cleanup
mm, slab: _FROZEN Cleanup
mm, vmscan: _FROZEN Cleanup
mm, vmstat: _FROZEN Cleanup
mm, memcontrol: _FROZEN Cleanup
mm, page_alloc: _FROZEN Cleanup
mm, slub: _FROZEN Cleanup
fs, buffer: _FROZEN Cleanup
xfs, xfs_mount: _FROZEN Cleanup
net, iucv: _FROZEN Cleanup
net, core, flow: _FROZEN Cleanup
net, core, dev: _FROZEN Cleanup
block, blk-mq: _FROZEN Cleanup
block, blk-iopoll: _FROZEN Cleanup
block, blk-softirq: _FROZEN Cleanup
driver, base, topology: _FROZEN Cleanup
clocksource, metag_generic: _FROZEN Cleanup
powercap, intel_rapl: _FROZEN Cleanup
cpuidle, cpuidle-powernv: _FROZEN Cleanup
cpuidle, cpuidle-pseries: _FROZEN Cleanup
cpufreq, acpi-cpufreq: _FROZEN Cleanup
irqchip, irq-armada-370-xp: _FROZEN Cleanup
irqchip, irq-gic: _FROZEN Cleanup
scsi, bnx2fc, bnx2fc_fcoe: _FROZEN Cleanup
scsi, bnx2i, bnx2i_init: _FROZEN Cleanup
scsi, fcoe: _FROZEN Cleanup
scsi, virtio_scsi: _FROZEN Cleanup
md, raid5: _FROZEN Cleanup
virt, kvm, arm, arch_timer: _FROZEN Cleanup
virt, kvm, arm, vgic: _FROZEN Cleanup
trace, ring_buffer: _FROZEN Cleanup
oprofile, timer_int: _FROZEN Cleanup
lib, cpu-notifier-error-inject: _FROZEN Cleanup
lib, percpu_counter: _FROZEN Cleanup
lib, radix-tree: _FROZEN Cleanup
staging, lustre, linux-cpu: _FROZEN Cleanup
cpu: Eliminate _FROZEN flags thoroughly
Thomas Gleixner (1):
cpu: Restructure FROZEN state handling
arch/arm/kvm/arm.c | 3 +-
arch/arm/vfp/vfpmodule.c | 6 +-
arch/ia64/kernel/err_inject.c | 4 +-
arch/ia64/kernel/mca.c | 3 +-
arch/ia64/kernel/palinfo.c | 4 +-
arch/ia64/kernel/salinfo.c | 4 +-
arch/ia64/kernel/topology.c | 4 +-
arch/mips/loongson/loongson-3/smp.c | 5 +-
arch/powerpc/kernel/sysfs.c | 4 +-
arch/powerpc/mm/mmu_context_nohash.c | 5 +-
arch/powerpc/mm/numa.c | 5 +-
arch/powerpc/platforms/powermac/smp.c | 11 ++--
arch/s390/kernel/perf_cpum_sf.c | 1 -
arch/sparc/kernel/sysfs.c | 4 +-
arch/x86/kernel/apic/x2apic_cluster.c | 11 +++-
arch/x86/kernel/cpu/intel_cacheinfo.c | 4 +-
arch/x86/kernel/cpu/mcheck/mce_amd.c | 4 +-
arch/x86/kernel/cpu/mcheck/therm_throt.c | 5 +-
arch/x86/kernel/cpu/microcode/core.c | 8 +--
arch/x86/kernel/cpuid.c | 6 +-
arch/x86/kernel/kvm.c | 9 +--
arch/x86/kernel/msr.c | 6 +-
arch/x86/kernel/vsyscall_64.c | 2 +-
arch/x86/pci/amd_bus.c | 3 +-
block/blk-iopoll.c | 2 +-
block/blk-mq.c | 10 ++--
block/blk-softirq.c | 2 +-
drivers/base/topology.c | 5 +-
drivers/clocksource/metag_generic.c | 3 +-
drivers/cpufreq/acpi-cpufreq.c | 4 +-
drivers/cpuidle/cpuidle-powernv.c | 4 +-
drivers/cpuidle/cpuidle-pseries.c | 4 +-
drivers/irqchip/irq-armada-370-xp.c | 2 +-
drivers/irqchip/irq-gic.c | 2 +-
drivers/md/raid5.c | 4 +-
drivers/oprofile/timer_int.c | 4 +-
drivers/powercap/intel_rapl.c | 5 +-
drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 4 +-
drivers/scsi/bnx2i/bnx2i_init.c | 4 +-
drivers/scsi/fcoe/fcoe.c | 4 +-
drivers/scsi/virtio_scsi.c | 4 +-
.../staging/lustre/lustre/libcfs/linux/linux-cpu.c | 6 +-
fs/buffer.c | 2 +-
fs/xfs/xfs_mount.c | 5 +-
include/linux/cpu.h | 9 ---
kernel/cpu.c | 66 +++++++++-------------
kernel/hrtimer.c | 10 +---
kernel/padata.c | 6 +-
kernel/profile.c | 6 +-
kernel/rcu/tree.c | 12 ++--
kernel/relay.c | 4 +-
kernel/sched/core.c | 55 ++++++++----------
kernel/smp.c | 8 +--
kernel/softirq.c | 3 +-
kernel/timer.c | 4 +-
kernel/trace/ring_buffer.c | 4 +-
lib/cpu-notifier-error-inject.c | 8 +--
lib/percpu_counter.c | 2 +-
lib/radix-tree.c | 2 +-
mm/memcontrol.c | 2 +-
mm/page_alloc.c | 2 +-
mm/slab.c | 8 +--
mm/slub.c | 4 +-
mm/vmscan.c | 2 +-
mm/vmstat.c | 6 +-
net/core/dev.c | 2 +-
net/core/flow.c | 4 +-
net/iucv/iucv.c | 8 +--
virt/kvm/arm/arch_timer.c | 4 +-
virt/kvm/arm/vgic.c | 4 +-
70 files changed, 159 insertions(+), 287 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread* [RFC PATCH v1 01/70] cpu: Restructure FROZEN state handling 2014-07-23 1:58 [RESEND RFC PATCH v1 0/70] Gloabl CPU Hot-plug flag _FROZEN Clean up Chen, Gong @ 2014-07-23 1:58 ` Chen, Gong 2014-07-23 13:50 ` Borislav Petkov 0 siblings, 1 reply; 3+ messages in thread From: Chen, Gong @ 2014-07-23 1:58 UTC (permalink / raw) To: linux-kernel Cc: mingo, tglx, paulus, benh, tony.luck, hpa, jkosina, rafael.j.wysocki, bp, linux, ralf, schwidefsky, davem, viro, fweisbec, cl, akpm, axboe, JBottomley, neilb, christoffer.dall, rostedt, rric, gregkh, mhocko, david, Chen, Gong From: Thomas Gleixner <tglx@linutronix.de> There are only a few callbacks which really care about FROZEN vs. !FROZEN. No need to have extra states for this. Publish the frozen state in an extra variable which is updated under the hotplug lock and let the users interested deal with it w/o imposing that extra state checks on everyone. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Chen, Gong <gong.chen@linux.intel.com> --- kernel/cpu.c | 66 +++++++++++++++++++++++++----------------------------------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index a343bde..3da7e82 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -27,6 +27,7 @@ #ifdef CONFIG_SMP /* Serializes the updates to cpu_online_mask, cpu_present_mask */ static DEFINE_MUTEX(cpu_add_remove_lock); +static bool cpuhp_tasks_frozen; /* * The following two APIs (cpu_maps_update_begin/done) must be used when @@ -194,27 +195,30 @@ int __ref __register_cpu_notifier(struct notifier_block *nb) return raw_notifier_chain_register(&cpu_chain, nb); } -static int __cpu_notify(unsigned long val, void *v, int nr_to_call, +static int __cpu_notify(unsigned long val, unsigned int cpu, int nr_to_call, int *nr_calls) { + unsigned long mod = cpuhp_tasks_frozen ? CPU_TASKS_FROZEN : 0; + void *hcpu = (void *)(long)cpu; + int ret; - ret = __raw_notifier_call_chain(&cpu_chain, val, v, nr_to_call, + ret = __raw_notifier_call_chain(&cpu_chain, val | mod, hcpu, nr_to_call, nr_calls); return notifier_to_errno(ret); } -static int cpu_notify(unsigned long val, void *v) +static int cpu_notify(unsigned long val, unsigned int cpu) { - return __cpu_notify(val, v, -1, NULL); + return __cpu_notify(val, cpu, -1, NULL); } #ifdef CONFIG_HOTPLUG_CPU -static void cpu_notify_nofail(unsigned long val, void *v) +static void cpu_notify_nofail(unsigned long val, unsigned int cpu) { - BUG_ON(cpu_notify(val, v)); + BUG_ON(cpu_notify(val, cpu)); } EXPORT_SYMBOL(register_cpu_notifier); EXPORT_SYMBOL(__register_cpu_notifier); @@ -291,23 +295,17 @@ static inline void check_for_tasks(int cpu) write_unlock_irq(&tasklist_lock); } -struct take_cpu_down_param { - unsigned long mod; - void *hcpu; -}; - /* Take this CPU down. */ static int __ref take_cpu_down(void *_param) { - struct take_cpu_down_param *param = _param; - int err; + int err, cpu = smp_processor_id(); /* Ensure this CPU doesn't handle any more interrupts. */ err = __cpu_disable(); if (err < 0) return err; - cpu_notify(CPU_DYING | param->mod, param->hcpu); + cpu_notify(CPU_DYING, cpu); /* Park the stopper thread */ kthread_park(current); return 0; @@ -317,12 +315,6 @@ static int __ref take_cpu_down(void *_param) static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) { int err, nr_calls = 0; - void *hcpu = (void *)(long)cpu; - unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0; - struct take_cpu_down_param tcd_param = { - .mod = mod, - .hcpu = hcpu, - }; if (num_online_cpus() == 1) return -EBUSY; @@ -332,10 +324,12 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) cpu_hotplug_begin(); - err = __cpu_notify(CPU_DOWN_PREPARE | mod, hcpu, -1, &nr_calls); + cpuhp_tasks_frozen = tasks_frozen; + + err = __cpu_notify(CPU_DOWN_PREPARE, cpu, -1, &nr_calls); if (err) { nr_calls--; - __cpu_notify(CPU_DOWN_FAILED | mod, hcpu, nr_calls, NULL); + __cpu_notify(CPU_DOWN_FAILED, cpu, nr_calls, NULL); pr_warn("%s: attempt to take down CPU %u failed\n", __func__, cpu); goto out_release; @@ -362,11 +356,11 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) * So now all preempt/rcu users must observe !cpu_active(). */ - err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu)); + err = __stop_machine(take_cpu_down, NULL, cpumask_of(cpu)); if (err) { /* CPU didn't die: tell everyone. Can't complain. */ smpboot_unpark_threads(cpu); - cpu_notify_nofail(CPU_DOWN_FAILED | mod, hcpu); + cpu_notify_nofail(CPU_DOWN_FAILED, cpu); goto out_release; } BUG_ON(cpu_online(cpu)); @@ -385,14 +379,14 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) __cpu_die(cpu); /* CPU is completely dead: tell everyone. Too late to complain. */ - cpu_notify_nofail(CPU_DEAD | mod, hcpu); + cpu_notify_nofail(CPU_DEAD, cpu); check_for_tasks(cpu); out_release: cpu_hotplug_done(); if (!err) - cpu_notify_nofail(CPU_POST_DEAD | mod, hcpu); + cpu_notify_nofail(CPU_POST_DEAD, cpu); return err; } @@ -419,10 +413,8 @@ EXPORT_SYMBOL(cpu_down); /* Requires cpu_add_remove_lock to be held */ static int _cpu_up(unsigned int cpu, int tasks_frozen) { - int ret, nr_calls = 0; - void *hcpu = (void *)(long)cpu; - unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0; struct task_struct *idle; + int ret, nr_calls = 0; cpu_hotplug_begin(); @@ -441,7 +433,9 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen) if (ret) goto out; - ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls); + cpuhp_tasks_frozen = tasks_frozen; + + ret = __cpu_notify(CPU_UP_PREPARE, cpu, -1, &nr_calls); if (ret) { nr_calls--; pr_warn("%s: attempt to bring up CPU %u failed\n", @@ -459,11 +453,11 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen) smpboot_unpark_threads(cpu); /* Now call notifier in preparation. */ - cpu_notify(CPU_ONLINE | mod, hcpu); + cpu_notify(CPU_ONLINE, cpu); out_notify: if (ret != 0) - __cpu_notify(CPU_UP_CANCELED | mod, hcpu, nr_calls, NULL); + __cpu_notify(CPU_UP_CANCELED, cpu, nr_calls, NULL); out: cpu_hotplug_done(); @@ -650,13 +644,7 @@ core_initcall(cpu_hotplug_pm_sync_init); */ void notify_cpu_starting(unsigned int cpu) { - unsigned long val = CPU_STARTING; - -#ifdef CONFIG_PM_SLEEP_SMP - if (frozen_cpus != NULL && cpumask_test_cpu(cpu, frozen_cpus)) - val = CPU_STARTING_FROZEN; -#endif /* CONFIG_PM_SLEEP_SMP */ - cpu_notify(val, (void *)(long)cpu); + cpu_notify(CPU_STARTING, cpu); } #endif /* CONFIG_SMP */ -- 2.0.0.rc2 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH v1 01/70] cpu: Restructure FROZEN state handling 2014-07-23 1:58 ` [RFC PATCH v1 01/70] cpu: Restructure FROZEN state handling Chen, Gong @ 2014-07-23 13:50 ` Borislav Petkov 0 siblings, 0 replies; 3+ messages in thread From: Borislav Petkov @ 2014-07-23 13:50 UTC (permalink / raw) To: Chen, Gong Cc: linux-kernel, mingo, tglx, paulus, benh, tony.luck, hpa, jkosina, rafael.j.wysocki, linux, ralf, schwidefsky, davem, viro, fweisbec, cl, akpm, axboe, JBottomley, neilb, christoffer.dall, rostedt, rric, gregkh, mhocko, david On Tue, Jul 22, 2014 at 09:58:37PM -0400, Chen, Gong wrote: > From: Thomas Gleixner <tglx@linutronix.de> > > There are only a few callbacks which really care about FROZEN > vs. !FROZEN. No need to have extra states for this. > > Publish the frozen state in an extra variable which is updated under > the hotplug lock and let the users interested deal with it w/o > imposing that extra state checks on everyone. > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de> > Signed-off-by: Chen, Gong <gong.chen@linux.intel.com> Acked-by: Borislav Petkov <bp@suse.de> -- Regards/Gruss, Boris. Sent from a fat crate under my desk. Formatting is fine. -- ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-23 13:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1406020218-6657-1-git-send-email-gong.chen@linux.intel.com>
2014-07-22 9:09 ` [RFC PATCH v1 01/70] cpu: Restructure FROZEN state handling Chen, Gong
2014-07-23 1:58 [RESEND RFC PATCH v1 0/70] Gloabl CPU Hot-plug flag _FROZEN Clean up Chen, Gong
2014-07-23 1:58 ` [RFC PATCH v1 01/70] cpu: Restructure FROZEN state handling Chen, Gong
2014-07-23 13:50 ` Borislav Petkov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
Powered by JetHome