Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'smp-core-2020-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull core SMP updates from Thomas Gleixner:
"CPU (hotplug) updates:

- Support for locked CSD objects in smp_call_function_single_async()
which allows to simplify callsites in the scheduler core and MIPS

- Treewide consolidation of CPU hotplug functions which ensures the
consistency between the sysfs interface and kernel state. The low
level functions cpu_up/down() are now confined to the core code and
not longer accessible from random code"

* tag 'smp-core-2020-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits)
cpu/hotplug: Ignore pm_wakeup_pending() for disable_nonboot_cpus()
cpu/hotplug: Hide cpu_up/down()
cpu/hotplug: Move bringup of secondary CPUs out of smp_init()
torture: Replace cpu_up/down() with add/remove_cpu()
firmware: psci: Replace cpu_up/down() with add/remove_cpu()
xen/cpuhotplug: Replace cpu_up/down() with device_online/offline()
parisc: Replace cpu_up/down() with add/remove_cpu()
sparc: Replace cpu_up/down() with add/remove_cpu()
powerpc: Replace cpu_up/down() with add/remove_cpu()
x86/smp: Replace cpu_up/down() with add/remove_cpu()
arm64: hibernate: Use bringup_hibernate_cpu()
cpu/hotplug: Provide bringup_hibernate_cpu()
arm64: Use reboot_cpu instead of hardconding it to 0
arm64: Don't use disable_nonboot_cpus()
ARM: Use reboot_cpu instead of hardcoding it to 0
ARM: Don't use disable_nonboot_cpus()
ia64: Replace cpu_down() with smp_shutdown_nonboot_cpus()
cpu/hotplug: Create a new function to shutdown nonboot cpus
cpu/hotplug: Add new {add,remove}_cpu() functions
sched/core: Remove rq.hrtick_csd_pending
...

+194 -97
+2 -2
arch/arm/kernel/reboot.c
··· 88 88 * to execute e.g. a RAM-based pin loop is not sufficient. This allows the 89 89 * kexec'd kernel to use any and all RAM as it sees fit, without having to 90 90 * avoid any code or data used by any SW CPU pin loop. The CPU hotplug 91 - * functionality embodied in disable_nonboot_cpus() to achieve this. 91 + * functionality embodied in smp_shutdown_nonboot_cpus() to achieve this. 92 92 */ 93 93 void machine_shutdown(void) 94 94 { 95 - disable_nonboot_cpus(); 95 + smp_shutdown_nonboot_cpus(reboot_cpu); 96 96 } 97 97 98 98 /*
+5 -8
arch/arm64/kernel/hibernate.c
··· 166 166 sleep_cpu = -EINVAL; 167 167 return -EINVAL; 168 168 } 169 - if (!cpu_online(sleep_cpu)) { 170 - pr_info("Hibernated on a CPU that is offline! Bringing CPU up.\n"); 171 - ret = cpu_up(sleep_cpu); 172 - if (ret) { 173 - pr_err("Failed to bring hibernate-CPU up!\n"); 174 - sleep_cpu = -EINVAL; 175 - return ret; 176 - } 169 + 170 + ret = bringup_hibernate_cpu(sleep_cpu); 171 + if (ret) { 172 + sleep_cpu = -EINVAL; 173 + return ret; 177 174 } 178 175 179 176 resume_hdr = *hdr;
+2 -2
arch/arm64/kernel/process.c
··· 141 141 * to execute e.g. a RAM-based pin loop is not sufficient. This allows the 142 142 * kexec'd kernel to use any and all RAM as it sees fit, without having to 143 143 * avoid any code or data used by any SW CPU pin loop. The CPU hotplug 144 - * functionality embodied in disable_nonboot_cpus() to achieve this. 144 + * functionality embodied in smpt_shutdown_nonboot_cpus() to achieve this. 145 145 */ 146 146 void machine_shutdown(void) 147 147 { 148 - disable_nonboot_cpus(); 148 + smp_shutdown_nonboot_cpus(reboot_cpu); 149 149 } 150 150 151 151 /*
+1 -7
arch/ia64/kernel/process.c
··· 646 646 647 647 void machine_shutdown(void) 648 648 { 649 - #ifdef CONFIG_HOTPLUG_CPU 650 - int cpu; 649 + smp_shutdown_nonboot_cpus(reboot_cpu); 651 650 652 - for_each_online_cpu(cpu) { 653 - if (cpu != smp_processor_id()) 654 - cpu_down(cpu); 655 - } 656 - #endif 657 651 #ifdef CONFIG_KEXEC 658 652 kexec_disable_iosapic(); 659 653 #endif
+1 -8
arch/mips/kernel/smp.c
··· 696 696 697 697 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST 698 698 699 - static DEFINE_PER_CPU(atomic_t, tick_broadcast_count); 700 699 static DEFINE_PER_CPU(call_single_data_t, tick_broadcast_csd); 701 700 702 701 void tick_broadcast(const struct cpumask *mask) 703 702 { 704 - atomic_t *count; 705 703 call_single_data_t *csd; 706 704 int cpu; 707 705 708 706 for_each_cpu(cpu, mask) { 709 - count = &per_cpu(tick_broadcast_count, cpu); 710 707 csd = &per_cpu(tick_broadcast_csd, cpu); 711 - 712 - if (atomic_inc_return(count) == 1) 713 - smp_call_function_single_async(cpu, csd); 708 + smp_call_function_single_async(cpu, csd); 714 709 } 715 710 } 716 711 717 712 static void tick_broadcast_callee(void *info) 718 713 { 719 - int cpu = smp_processor_id(); 720 714 tick_receive_broadcast(); 721 - atomic_set(&per_cpu(tick_broadcast_count, cpu), 0); 722 715 } 723 716 724 717 static int __init tick_broadcast_init(void)
+1 -1
arch/parisc/kernel/processor.c
··· 212 212 #ifdef CONFIG_SMP 213 213 if (cpuid) { 214 214 set_cpu_present(cpuid, true); 215 - cpu_up(cpuid); 215 + add_cpu(cpuid); 216 216 } 217 217 #endif 218 218
+1 -1
arch/powerpc/kexec/core_64.c
··· 212 212 if (!cpu_online(cpu)) { 213 213 printk(KERN_INFO "kexec: Waking offline cpu %d.\n", 214 214 cpu); 215 - WARN_ON(cpu_up(cpu)); 215 + WARN_ON(add_cpu(cpu)); 216 216 } 217 217 } 218 218 }
+2 -2
arch/sparc/kernel/ds.c
··· 555 555 556 556 printk(KERN_INFO "ds-%llu: Starting cpu %d...\n", 557 557 dp->id, cpu); 558 - err = cpu_up(cpu); 558 + err = add_cpu(cpu); 559 559 if (err) { 560 560 __u32 res = DR_CPU_RES_FAILURE; 561 561 __u32 stat = DR_CPU_STAT_UNCONFIGURED; ··· 611 611 612 612 printk(KERN_INFO "ds-%llu: Shutting down cpu %d...\n", 613 613 dp->id, cpu); 614 - err = cpu_down(cpu); 614 + err = remove_cpu(cpu); 615 615 if (err) 616 616 dr_cpu_mark(resp, cpu, ncpus, 617 617 DR_CPU_RES_FAILURE,
+6 -16
arch/x86/kernel/topology.c
··· 59 59 */ 60 60 int _debug_hotplug_cpu(int cpu, int action) 61 61 { 62 - struct device *dev = get_cpu_device(cpu); 63 62 int ret; 64 63 65 64 if (!cpu_is_hotpluggable(cpu)) 66 65 return -EINVAL; 67 66 68 - lock_device_hotplug(); 69 - 70 67 switch (action) { 71 68 case 0: 72 - ret = cpu_down(cpu); 73 - if (!ret) { 69 + ret = remove_cpu(cpu); 70 + if (!ret) 74 71 pr_info("DEBUG_HOTPLUG_CPU0: CPU %u is now offline\n", cpu); 75 - dev->offline = true; 76 - kobject_uevent(&dev->kobj, KOBJ_OFFLINE); 77 - } else 72 + else 78 73 pr_debug("Can't offline CPU%d.\n", cpu); 79 74 break; 80 75 case 1: 81 - ret = cpu_up(cpu); 82 - if (!ret) { 83 - dev->offline = false; 84 - kobject_uevent(&dev->kobj, KOBJ_ONLINE); 85 - } else { 76 + ret = add_cpu(cpu); 77 + if (ret) 86 78 pr_debug("Can't online CPU%d.\n", cpu); 87 - } 79 + 88 80 break; 89 81 default: 90 82 ret = -EINVAL; 91 83 } 92 - 93 - unlock_device_hotplug(); 94 84 95 85 return ret; 96 86 }
+2 -2
arch/x86/mm/mmio-mod.c
··· 386 386 put_online_cpus(); 387 387 388 388 for_each_cpu(cpu, downed_cpus) { 389 - err = cpu_down(cpu); 389 + err = remove_cpu(cpu); 390 390 if (!err) 391 391 pr_info("CPU%d is down.\n", cpu); 392 392 else ··· 406 406 return; 407 407 pr_notice("Re-enabling CPUs...\n"); 408 408 for_each_cpu(cpu, downed_cpus) { 409 - err = cpu_up(cpu); 409 + err = add_cpu(cpu); 410 410 if (!err) 411 411 pr_info("enabled CPU%d.\n", cpu); 412 412 else
+1 -1
arch/x86/xen/smp.c
··· 132 132 if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS) 133 133 continue; 134 134 135 - rc = cpu_down(cpu); 135 + rc = remove_cpu(cpu); 136 136 137 137 if (rc == 0) { 138 138 /*
+2 -2
drivers/base/cpu.c
··· 55 55 if (from_nid == NUMA_NO_NODE) 56 56 return -ENODEV; 57 57 58 - ret = cpu_up(cpuid); 58 + ret = cpu_device_up(dev); 59 59 /* 60 60 * When hot adding memory to memoryless node and enabling a cpu 61 61 * on the node, node number of the cpu may internally change. ··· 69 69 70 70 static int cpu_subsys_offline(struct device *dev) 71 71 { 72 - return cpu_down(dev->id); 72 + return cpu_device_down(dev); 73 73 } 74 74 75 75 void unregister_cpu(struct cpu *cpu)
+2 -2
drivers/firmware/psci/psci_checker.c
··· 84 84 85 85 /* Try to power down all CPUs in the mask. */ 86 86 for_each_cpu(cpu, cpus) { 87 - int ret = cpu_down(cpu); 87 + int ret = remove_cpu(cpu); 88 88 89 89 /* 90 90 * cpu_down() checks the number of online CPUs before the TOS ··· 116 116 117 117 /* Try to power up all the CPUs that have been offlined. */ 118 118 for_each_cpu(cpu, offlined_cpus) { 119 - int ret = cpu_up(cpu); 119 + int ret = add_cpu(cpu); 120 120 121 121 if (ret != 0) { 122 122 pr_err("Error occurred (%d) while trying "
+1 -1
drivers/xen/cpu_hotplug.c
··· 94 94 95 95 for_each_possible_cpu(cpu) { 96 96 if (vcpu_online(cpu) == 0) { 97 - (void)cpu_down(cpu); 97 + device_offline(get_cpu_device(cpu)); 98 98 set_cpu_present(cpu, false); 99 99 } 100 100 }
+17 -5
include/linux/cpu.h
··· 88 88 89 89 #ifdef CONFIG_SMP 90 90 extern bool cpuhp_tasks_frozen; 91 - int cpu_up(unsigned int cpu); 91 + int add_cpu(unsigned int cpu); 92 + int cpu_device_up(struct device *dev); 92 93 void notify_cpu_starting(unsigned int cpu); 93 94 extern void cpu_maps_update_begin(void); 94 95 extern void cpu_maps_update_done(void); 96 + int bringup_hibernate_cpu(unsigned int sleep_cpu); 97 + void bringup_nonboot_cpus(unsigned int setup_max_cpus); 95 98 96 99 #else /* CONFIG_SMP */ 97 100 #define cpuhp_tasks_frozen 0 ··· 120 117 extern void cpu_hotplug_disable(void); 121 118 extern void cpu_hotplug_enable(void); 122 119 void clear_tasks_mm_cpumask(int cpu); 123 - int cpu_down(unsigned int cpu); 120 + int remove_cpu(unsigned int cpu); 121 + int cpu_device_down(struct device *dev); 122 + extern void smp_shutdown_nonboot_cpus(unsigned int primary_cpu); 124 123 125 124 #else /* CONFIG_HOTPLUG_CPU */ 126 125 ··· 134 129 static inline void lockdep_assert_cpus_held(void) { } 135 130 static inline void cpu_hotplug_disable(void) { } 136 131 static inline void cpu_hotplug_enable(void) { } 132 + static inline void smp_shutdown_nonboot_cpus(unsigned int primary_cpu) { } 137 133 #endif /* !CONFIG_HOTPLUG_CPU */ 138 134 139 135 /* Wrappers which go away once all code is converted */ ··· 144 138 static inline void put_online_cpus(void) { cpus_read_unlock(); } 145 139 146 140 #ifdef CONFIG_PM_SLEEP_SMP 147 - extern int freeze_secondary_cpus(int primary); 141 + int __freeze_secondary_cpus(int primary, bool suspend); 142 + static inline int freeze_secondary_cpus(int primary) 143 + { 144 + return __freeze_secondary_cpus(primary, true); 145 + } 146 + 148 147 static inline int disable_nonboot_cpus(void) 149 148 { 150 - return freeze_secondary_cpus(0); 149 + return __freeze_secondary_cpus(0, false); 151 150 } 152 - extern void enable_nonboot_cpus(void); 151 + 152 + void enable_nonboot_cpus(void); 153 153 154 154 static inline int suspend_disable_secondary_cpus(void) 155 155 {
+129 -14
kernel/cpu.c
··· 1041 1041 return _cpu_down(cpu, 0, target); 1042 1042 } 1043 1043 1044 - static int do_cpu_down(unsigned int cpu, enum cpuhp_state target) 1044 + static int cpu_down(unsigned int cpu, enum cpuhp_state target) 1045 1045 { 1046 1046 int err; 1047 1047 ··· 1051 1051 return err; 1052 1052 } 1053 1053 1054 - int cpu_down(unsigned int cpu) 1054 + /** 1055 + * cpu_device_down - Bring down a cpu device 1056 + * @dev: Pointer to the cpu device to offline 1057 + * 1058 + * This function is meant to be used by device core cpu subsystem only. 1059 + * 1060 + * Other subsystems should use remove_cpu() instead. 1061 + */ 1062 + int cpu_device_down(struct device *dev) 1055 1063 { 1056 - return do_cpu_down(cpu, CPUHP_OFFLINE); 1064 + return cpu_down(dev->id, CPUHP_OFFLINE); 1057 1065 } 1058 - EXPORT_SYMBOL(cpu_down); 1066 + 1067 + int remove_cpu(unsigned int cpu) 1068 + { 1069 + int ret; 1070 + 1071 + lock_device_hotplug(); 1072 + ret = device_offline(get_cpu_device(cpu)); 1073 + unlock_device_hotplug(); 1074 + 1075 + return ret; 1076 + } 1077 + EXPORT_SYMBOL_GPL(remove_cpu); 1078 + 1079 + void smp_shutdown_nonboot_cpus(unsigned int primary_cpu) 1080 + { 1081 + unsigned int cpu; 1082 + int error; 1083 + 1084 + cpu_maps_update_begin(); 1085 + 1086 + /* 1087 + * Make certain the cpu I'm about to reboot on is online. 1088 + * 1089 + * This is inline to what migrate_to_reboot_cpu() already do. 1090 + */ 1091 + if (!cpu_online(primary_cpu)) 1092 + primary_cpu = cpumask_first(cpu_online_mask); 1093 + 1094 + for_each_online_cpu(cpu) { 1095 + if (cpu == primary_cpu) 1096 + continue; 1097 + 1098 + error = cpu_down_maps_locked(cpu, CPUHP_OFFLINE); 1099 + if (error) { 1100 + pr_err("Failed to offline CPU%d - error=%d", 1101 + cpu, error); 1102 + break; 1103 + } 1104 + } 1105 + 1106 + /* 1107 + * Ensure all but the reboot CPU are offline. 1108 + */ 1109 + BUG_ON(num_online_cpus() > 1); 1110 + 1111 + /* 1112 + * Make sure the CPUs won't be enabled by someone else after this 1113 + * point. Kexec will reboot to a new kernel shortly resetting 1114 + * everything along the way. 1115 + */ 1116 + cpu_hotplug_disabled++; 1117 + 1118 + cpu_maps_update_done(); 1119 + } 1059 1120 1060 1121 #else 1061 1122 #define takedown_cpu NULL ··· 1185 1124 } 1186 1125 1187 1126 /* 1188 - * The caller of do_cpu_up might have raced with another 1189 - * caller. Ignore it for now. 1127 + * The caller of cpu_up() might have raced with another 1128 + * caller. Nothing to do. 1190 1129 */ 1191 1130 if (st->state >= target) 1192 1131 goto out; ··· 1230 1169 return ret; 1231 1170 } 1232 1171 1233 - static int do_cpu_up(unsigned int cpu, enum cpuhp_state target) 1172 + static int cpu_up(unsigned int cpu, enum cpuhp_state target) 1234 1173 { 1235 1174 int err = 0; 1236 1175 ··· 1264 1203 return err; 1265 1204 } 1266 1205 1267 - int cpu_up(unsigned int cpu) 1206 + /** 1207 + * cpu_device_up - Bring up a cpu device 1208 + * @dev: Pointer to the cpu device to online 1209 + * 1210 + * This function is meant to be used by device core cpu subsystem only. 1211 + * 1212 + * Other subsystems should use add_cpu() instead. 1213 + */ 1214 + int cpu_device_up(struct device *dev) 1268 1215 { 1269 - return do_cpu_up(cpu, CPUHP_ONLINE); 1216 + return cpu_up(dev->id, CPUHP_ONLINE); 1270 1217 } 1271 - EXPORT_SYMBOL_GPL(cpu_up); 1218 + 1219 + int add_cpu(unsigned int cpu) 1220 + { 1221 + int ret; 1222 + 1223 + lock_device_hotplug(); 1224 + ret = device_online(get_cpu_device(cpu)); 1225 + unlock_device_hotplug(); 1226 + 1227 + return ret; 1228 + } 1229 + EXPORT_SYMBOL_GPL(add_cpu); 1230 + 1231 + /** 1232 + * bringup_hibernate_cpu - Bring up the CPU that we hibernated on 1233 + * @sleep_cpu: The cpu we hibernated on and should be brought up. 1234 + * 1235 + * On some architectures like arm64, we can hibernate on any CPU, but on 1236 + * wake up the CPU we hibernated on might be offline as a side effect of 1237 + * using maxcpus= for example. 1238 + */ 1239 + int bringup_hibernate_cpu(unsigned int sleep_cpu) 1240 + { 1241 + int ret; 1242 + 1243 + if (!cpu_online(sleep_cpu)) { 1244 + pr_info("Hibernated on a CPU that is offline! Bringing CPU up.\n"); 1245 + ret = cpu_up(sleep_cpu, CPUHP_ONLINE); 1246 + if (ret) { 1247 + pr_err("Failed to bring hibernate-CPU up!\n"); 1248 + return ret; 1249 + } 1250 + } 1251 + return 0; 1252 + } 1253 + 1254 + void bringup_nonboot_cpus(unsigned int setup_max_cpus) 1255 + { 1256 + unsigned int cpu; 1257 + 1258 + for_each_present_cpu(cpu) { 1259 + if (num_online_cpus() >= setup_max_cpus) 1260 + break; 1261 + if (!cpu_online(cpu)) 1262 + cpu_up(cpu, CPUHP_ONLINE); 1263 + } 1264 + } 1272 1265 1273 1266 #ifdef CONFIG_PM_SLEEP_SMP 1274 1267 static cpumask_var_t frozen_cpus; 1275 1268 1276 - int freeze_secondary_cpus(int primary) 1269 + int __freeze_secondary_cpus(int primary, bool suspend) 1277 1270 { 1278 1271 int cpu, error = 0; 1279 1272 ··· 1352 1237 if (cpu == primary) 1353 1238 continue; 1354 1239 1355 - if (pm_wakeup_pending()) { 1240 + if (suspend && pm_wakeup_pending()) { 1356 1241 pr_info("Wakeup pending. Abort CPU freeze\n"); 1357 1242 error = -EBUSY; 1358 1243 break; ··· 2143 2028 goto out; 2144 2029 2145 2030 if (st->state < target) 2146 - ret = do_cpu_up(dev->id, target); 2031 + ret = cpu_up(dev->id, target); 2147 2032 else 2148 - ret = do_cpu_down(dev->id, target); 2033 + ret = cpu_down(dev->id, target); 2149 2034 out: 2150 2035 unlock_device_hotplug(); 2151 2036 return ret ? ret : count;
+2 -7
kernel/sched/core.c
··· 269 269 270 270 rq_lock(rq, &rf); 271 271 __hrtick_restart(rq); 272 - rq->hrtick_csd_pending = 0; 273 272 rq_unlock(rq, &rf); 274 273 } 275 274 ··· 292 293 293 294 hrtimer_set_expires(timer, time); 294 295 295 - if (rq == this_rq()) { 296 + if (rq == this_rq()) 296 297 __hrtick_restart(rq); 297 - } else if (!rq->hrtick_csd_pending) { 298 + else 298 299 smp_call_function_single_async(cpu_of(rq), &rq->hrtick_csd); 299 - rq->hrtick_csd_pending = 1; 300 - } 301 300 } 302 301 303 302 #else ··· 319 322 static void hrtick_rq_init(struct rq *rq) 320 323 { 321 324 #ifdef CONFIG_SMP 322 - rq->hrtick_csd_pending = 0; 323 - 324 325 rq->hrtick_csd.flags = 0; 325 326 rq->hrtick_csd.func = __hrtick_start; 326 327 rq->hrtick_csd.info = rq;
-1
kernel/sched/sched.h
··· 992 992 993 993 #ifdef CONFIG_SCHED_HRTICK 994 994 #ifdef CONFIG_SMP 995 - int hrtick_csd_pending; 996 995 call_single_data_t hrtick_csd; 997 996 #endif 998 997 struct hrtimer hrtick_timer;
+12 -11
kernel/smp.c
··· 329 329 * (ie: embedded in an object) and is responsible for synchronizing it 330 330 * such that the IPIs performed on the @csd are strictly serialized. 331 331 * 332 + * If the function is called with one csd which has not yet been 333 + * processed by previous call to smp_call_function_single_async(), the 334 + * function will return immediately with -EBUSY showing that the csd 335 + * object is still in progress. 336 + * 332 337 * NOTE: Be careful, there is unfortunately no current debugging facility to 333 338 * validate the correctness of this serialization. 334 339 */ ··· 343 338 344 339 preempt_disable(); 345 340 346 - /* We could deadlock if we have to wait here with interrupts disabled! */ 347 - if (WARN_ON_ONCE(csd->flags & CSD_FLAG_LOCK)) 348 - csd_lock_wait(csd); 341 + if (csd->flags & CSD_FLAG_LOCK) { 342 + err = -EBUSY; 343 + goto out; 344 + } 349 345 350 346 csd->flags = CSD_FLAG_LOCK; 351 347 smp_wmb(); 352 348 353 349 err = generic_exec_single(cpu, csd, csd->func, csd->info); 350 + 351 + out: 354 352 preempt_enable(); 355 353 356 354 return err; ··· 597 589 void __init smp_init(void) 598 590 { 599 591 int num_nodes, num_cpus; 600 - unsigned int cpu; 601 592 602 593 idle_threads_init(); 603 594 cpuhp_threads_init(); 604 595 605 596 pr_info("Bringing up secondary CPUs ...\n"); 606 597 607 - /* FIXME: This should be done in userspace --RR */ 608 - for_each_present_cpu(cpu) { 609 - if (num_online_cpus() >= setup_max_cpus) 610 - break; 611 - if (!cpu_online(cpu)) 612 - cpu_up(cpu); 613 - } 598 + bringup_nonboot_cpus(setup_max_cpus); 614 599 615 600 num_nodes = num_online_nodes(); 616 601 num_cpus = num_online_cpus();
+5 -4
kernel/torture.c
··· 101 101 torture_type, cpu); 102 102 starttime = jiffies; 103 103 (*n_offl_attempts)++; 104 - ret = cpu_down(cpu); 104 + ret = remove_cpu(cpu); 105 105 if (ret) { 106 106 s = ""; 107 107 if (!rcu_inkernel_boot_has_ended() && ret == -EBUSY) { ··· 159 159 torture_type, cpu); 160 160 starttime = jiffies; 161 161 (*n_onl_attempts)++; 162 - ret = cpu_up(cpu); 162 + ret = add_cpu(cpu); 163 163 if (ret) { 164 164 s = ""; 165 165 if (!rcu_inkernel_boot_has_ended() && ret == -EBUSY) { ··· 209 209 for_each_online_cpu(cpu) 210 210 maxcpu = cpu; 211 211 WARN_ON(maxcpu < 0); 212 - if (!IS_MODULE(CONFIG_TORTURE_TEST)) 212 + if (!IS_MODULE(CONFIG_TORTURE_TEST)) { 213 213 for_each_possible_cpu(cpu) { 214 214 if (cpu_online(cpu)) 215 215 continue; 216 - ret = cpu_up(cpu); 216 + ret = add_cpu(cpu); 217 217 if (ret && verbose) { 218 218 pr_alert("%s" TORTURE_FLAG 219 219 "%s: Initial online %d: errno %d\n", 220 220 __func__, torture_type, cpu, ret); 221 221 } 222 222 } 223 + } 223 224 224 225 if (maxcpu == 0) { 225 226 VERBOSE_TOROUT_STRING("Only one CPU, so CPU-hotplug testing is disabled");