Commit 3e8eb22f authored by Heiko Carstens's avatar Heiko Carstens

s390: enforce CONFIG_HOTPLUG_CPU

x86 and powerpc (partially) enforce already CONFIG_HOTPLUG_CPU. On
s390 it is enabled on all distributions by default since ages.
The only exception is our zfcpdump kernel.

However to simplify testing, enforce HOTPLUG_CPU. This was suggested
by Paul McKenney, since his rcutorture test environments for CONFIG_SMP=y
only support HOTPLUG_CPU=y.
Suggested-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent 67626fad
...@@ -413,11 +413,6 @@ config NR_CPUS ...@@ -413,11 +413,6 @@ config NR_CPUS
config HOTPLUG_CPU config HOTPLUG_CPU
def_bool y def_bool y
prompt "Support for hot-pluggable CPUs"
help
Say Y here to be able to turn CPUs off and on. CPUs
can be controlled through /sys/devices/system/cpu/cpu#.
Say N if you want to disable CPU hotplug.
# Some NUMA nodes have memory ranges that span # Some NUMA nodes have memory ranges that span
# other nodes. Even though a pfn is valid and # other nodes. Even though a pfn is valid and
......
...@@ -53,14 +53,9 @@ static inline int smp_get_base_cpu(int cpu) ...@@ -53,14 +53,9 @@ static inline int smp_get_base_cpu(int cpu)
return cpu - (cpu % (smp_cpu_mtid + 1)); return cpu - (cpu % (smp_cpu_mtid + 1));
} }
#ifdef CONFIG_HOTPLUG_CPU
extern int smp_rescan_cpus(void); extern int smp_rescan_cpus(void);
extern void __noreturn cpu_die(void); extern void __noreturn cpu_die(void);
extern void __cpu_die(unsigned int cpu); extern void __cpu_die(unsigned int cpu);
extern int __cpu_disable(void); extern int __cpu_disable(void);
#else
static inline int smp_rescan_cpus(void) { return 0; }
static inline void cpu_die(void) { }
#endif
#endif /* __ASM_SMP_H */ #endif /* __ASM_SMP_H */
...@@ -232,8 +232,6 @@ static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu) ...@@ -232,8 +232,6 @@ static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu)
return -ENOMEM; return -ENOMEM;
} }
#ifdef CONFIG_HOTPLUG_CPU
static void pcpu_free_lowcore(struct pcpu *pcpu) static void pcpu_free_lowcore(struct pcpu *pcpu)
{ {
unsigned long async_stack, nodat_stack, lowcore; unsigned long async_stack, nodat_stack, lowcore;
...@@ -253,8 +251,6 @@ static void pcpu_free_lowcore(struct pcpu *pcpu) ...@@ -253,8 +251,6 @@ static void pcpu_free_lowcore(struct pcpu *pcpu)
free_pages(lowcore, LC_ORDER); free_pages(lowcore, LC_ORDER);
} }
#endif /* CONFIG_HOTPLUG_CPU */
static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu) static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu)
{ {
struct lowcore *lc = pcpu->lowcore; struct lowcore *lc = pcpu->lowcore;
...@@ -895,8 +891,6 @@ static int __init _setup_possible_cpus(char *s) ...@@ -895,8 +891,6 @@ static int __init _setup_possible_cpus(char *s)
} }
early_param("possible_cpus", _setup_possible_cpus); early_param("possible_cpus", _setup_possible_cpus);
#ifdef CONFIG_HOTPLUG_CPU
int __cpu_disable(void) int __cpu_disable(void)
{ {
unsigned long cregs[16]; unsigned long cregs[16];
...@@ -937,8 +931,6 @@ void __noreturn cpu_die(void) ...@@ -937,8 +931,6 @@ void __noreturn cpu_die(void)
for (;;) ; for (;;) ;
} }
#endif /* CONFIG_HOTPLUG_CPU */
void __init smp_fill_possible_mask(void) void __init smp_fill_possible_mask(void)
{ {
unsigned int possible, sclp_max, cpu; unsigned int possible, sclp_max, cpu;
...@@ -996,7 +988,6 @@ int setup_profiling_timer(unsigned int multiplier) ...@@ -996,7 +988,6 @@ int setup_profiling_timer(unsigned int multiplier)
return 0; return 0;
} }
#ifdef CONFIG_HOTPLUG_CPU
static ssize_t cpu_configure_show(struct device *dev, static ssize_t cpu_configure_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
...@@ -1073,7 +1064,6 @@ static ssize_t cpu_configure_store(struct device *dev, ...@@ -1073,7 +1064,6 @@ static ssize_t cpu_configure_store(struct device *dev,
return rc ? rc : count; return rc ? rc : count;
} }
static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store); static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
#endif /* CONFIG_HOTPLUG_CPU */
static ssize_t show_cpu_address(struct device *dev, static ssize_t show_cpu_address(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
...@@ -1083,9 +1073,7 @@ static ssize_t show_cpu_address(struct device *dev, ...@@ -1083,9 +1073,7 @@ static ssize_t show_cpu_address(struct device *dev,
static DEVICE_ATTR(address, 0444, show_cpu_address, NULL); static DEVICE_ATTR(address, 0444, show_cpu_address, NULL);
static struct attribute *cpu_common_attrs[] = { static struct attribute *cpu_common_attrs[] = {
#ifdef CONFIG_HOTPLUG_CPU
&dev_attr_configure.attr, &dev_attr_configure.attr,
#endif
&dev_attr_address.attr, &dev_attr_address.attr,
NULL, NULL,
}; };
...@@ -1144,15 +1132,11 @@ static int smp_add_present_cpu(int cpu) ...@@ -1144,15 +1132,11 @@ static int smp_add_present_cpu(int cpu)
out_topology: out_topology:
sysfs_remove_group(&s->kobj, &cpu_common_attr_group); sysfs_remove_group(&s->kobj, &cpu_common_attr_group);
out_cpu: out_cpu:
#ifdef CONFIG_HOTPLUG_CPU
unregister_cpu(c); unregister_cpu(c);
#endif
out: out:
return rc; return rc;
} }
#ifdef CONFIG_HOTPLUG_CPU
int __ref smp_rescan_cpus(void) int __ref smp_rescan_cpus(void)
{ {
struct sclp_core_info *info; struct sclp_core_info *info;
...@@ -1188,17 +1172,14 @@ static ssize_t __ref rescan_store(struct device *dev, ...@@ -1188,17 +1172,14 @@ static ssize_t __ref rescan_store(struct device *dev,
return rc ? rc : count; return rc ? rc : count;
} }
static DEVICE_ATTR_WO(rescan); static DEVICE_ATTR_WO(rescan);
#endif /* CONFIG_HOTPLUG_CPU */
static int __init s390_smp_init(void) static int __init s390_smp_init(void)
{ {
int cpu, rc = 0; int cpu, rc = 0;
#ifdef CONFIG_HOTPLUG_CPU
rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan); rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan);
if (rc) if (rc)
return rc; return rc;
#endif
for_each_present_cpu(cpu) { for_each_present_cpu(cpu) {
rc = smp_add_present_cpu(cpu); rc = smp_add_present_cpu(cpu);
if (rc) if (rc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment