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

Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull SMP/hotplug updates from Thomas Gleixner:
"A small set of updates for SMP and CPU hotplug:

- Abort disabling secondary CPUs in the freezer when a wakeup is
pending instead of evaluating it only after all CPUs have been
offlined.

- Remove the shared annotation for the strict per CPU cfd_data in the
smp function call core code.

- Remove the return values of smp_call_function() and on_each_cpu()
as they are unconditionally 0. Fixup the few callers which actually
bothered to check the return value"

* 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
smp: Remove smp_call_function() and on_each_cpu() return values
smp: Do not mark call_function_data as shared
cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending
cpu/hotplug: Fix notify_cpu_starting() reference in bringup_wait_for_ap()

+36 -55
+5 -14
arch/alpha/kernel/smp.c
··· 614 614 smp_imb(void) 615 615 { 616 616 /* Must wait other processors to flush their icache before continue. */ 617 - if (on_each_cpu(ipi_imb, NULL, 1)) 618 - printk(KERN_CRIT "smp_imb: timed out\n"); 617 + on_each_cpu(ipi_imb, NULL, 1); 619 618 } 620 619 EXPORT_SYMBOL(smp_imb); 621 620 ··· 629 630 { 630 631 /* Although we don't have any data to pass, we do want to 631 632 synchronize with the other processors. */ 632 - if (on_each_cpu(ipi_flush_tlb_all, NULL, 1)) { 633 - printk(KERN_CRIT "flush_tlb_all: timed out\n"); 634 - } 633 + on_each_cpu(ipi_flush_tlb_all, NULL, 1); 635 634 } 636 635 637 636 #define asn_locked() (cpu_data[smp_processor_id()].asn_lock) ··· 664 667 } 665 668 } 666 669 667 - if (smp_call_function(ipi_flush_tlb_mm, mm, 1)) { 668 - printk(KERN_CRIT "flush_tlb_mm: timed out\n"); 669 - } 670 + smp_call_function(ipi_flush_tlb_mm, mm, 1); 670 671 671 672 preempt_enable(); 672 673 } ··· 715 720 data.mm = mm; 716 721 data.addr = addr; 717 722 718 - if (smp_call_function(ipi_flush_tlb_page, &data, 1)) { 719 - printk(KERN_CRIT "flush_tlb_page: timed out\n"); 720 - } 723 + smp_call_function(ipi_flush_tlb_page, &data, 1); 721 724 722 725 preempt_enable(); 723 726 } ··· 765 772 } 766 773 } 767 774 768 - if (smp_call_function(ipi_flush_icache_page, mm, 1)) { 769 - printk(KERN_CRIT "flush_icache_page: timed out\n"); 770 - } 775 + smp_call_function(ipi_flush_icache_page, mm, 1); 771 776 772 777 preempt_enable(); 773 778 }
+3 -3
arch/alpha/oprofile/common.c
··· 65 65 model->reg_setup(&reg, ctr, &sys); 66 66 67 67 /* Configure the registers on all cpus. */ 68 - (void)smp_call_function(model->cpu_setup, &reg, 1); 68 + smp_call_function(model->cpu_setup, &reg, 1); 69 69 model->cpu_setup(&reg); 70 70 return 0; 71 71 } ··· 86 86 static int 87 87 op_axp_start(void) 88 88 { 89 - (void)smp_call_function(op_axp_cpu_start, NULL, 1); 89 + smp_call_function(op_axp_cpu_start, NULL, 1); 90 90 op_axp_cpu_start(NULL); 91 91 return 0; 92 92 } ··· 101 101 static void 102 102 op_axp_stop(void) 103 103 { 104 - (void)smp_call_function(op_axp_cpu_stop, NULL, 1); 104 + smp_call_function(op_axp_cpu_stop, NULL, 1); 105 105 op_axp_cpu_stop(NULL); 106 106 } 107 107
+2 -4
arch/arm/common/bL_switcher.c
··· 539 539 540 540 int bL_switcher_trace_trigger(void) 541 541 { 542 - int ret; 543 - 544 542 preempt_disable(); 545 543 546 544 bL_switcher_trace_trigger_cpu(NULL); 547 - ret = smp_call_function(bL_switcher_trace_trigger_cpu, NULL, true); 545 + smp_call_function(bL_switcher_trace_trigger_cpu, NULL, true); 548 546 549 547 preempt_enable(); 550 548 551 - return ret; 549 + return 0; 552 550 } 553 551 EXPORT_SYMBOL_GPL(bL_switcher_trace_trigger); 554 552
+2 -10
arch/ia64/kernel/perfmon.c
··· 6390 6390 } 6391 6391 6392 6392 /* save the current system wide pmu states */ 6393 - ret = on_each_cpu(pfm_alt_save_pmu_state, NULL, 1); 6394 - if (ret) { 6395 - DPRINT(("on_each_cpu() failed: %d\n", ret)); 6396 - goto cleanup_reserve; 6397 - } 6393 + on_each_cpu(pfm_alt_save_pmu_state, NULL, 1); 6398 6394 6399 6395 /* officially change to the alternate interrupt handler */ 6400 6396 pfm_alt_intr_handler = hdl; ··· 6417 6421 pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl) 6418 6422 { 6419 6423 int i; 6420 - int ret; 6421 6424 6422 6425 if (hdl == NULL) return -EINVAL; 6423 6426 ··· 6430 6435 6431 6436 pfm_alt_intr_handler = NULL; 6432 6437 6433 - ret = on_each_cpu(pfm_alt_restore_pmu_state, NULL, 1); 6434 - if (ret) { 6435 - DPRINT(("on_each_cpu() failed: %d\n", ret)); 6436 - } 6438 + on_each_cpu(pfm_alt_restore_pmu_state, NULL, 1); 6437 6439 6438 6440 for_each_online_cpu(i) { 6439 6441 pfm_unreserve_session(NULL, 1, i);
+4 -4
arch/ia64/kernel/uncached.c
··· 121 121 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL); 122 122 if (status == PAL_VISIBILITY_OK_REMOTE_NEEDED) { 123 123 atomic_set(&uc_pool->status, 0); 124 - status = smp_call_function(uncached_ipi_visibility, uc_pool, 1); 125 - if (status || atomic_read(&uc_pool->status)) 124 + smp_call_function(uncached_ipi_visibility, uc_pool, 1); 125 + if (atomic_read(&uc_pool->status)) 126 126 goto failed; 127 127 } else if (status != PAL_VISIBILITY_OK) 128 128 goto failed; ··· 143 143 if (status != PAL_STATUS_SUCCESS) 144 144 goto failed; 145 145 atomic_set(&uc_pool->status, 0); 146 - status = smp_call_function(uncached_ipi_mc_drain, uc_pool, 1); 147 - if (status || atomic_read(&uc_pool->status)) 146 + smp_call_function(uncached_ipi_mc_drain, uc_pool, 1); 147 + if (atomic_read(&uc_pool->status)) 148 148 goto failed; 149 149 150 150 /*
+1 -2
arch/powerpc/kernel/rtas.c
··· 990 990 /* Call function on all CPUs. One of us will make the 991 991 * rtas call 992 992 */ 993 - if (on_each_cpu(rtas_percpu_suspend_me, &data, 0)) 994 - atomic_set(&data.error, -EINVAL); 993 + on_each_cpu(rtas_percpu_suspend_me, &data, 0); 995 994 996 995 wait_for_completion(&done); 997 996
+2 -1
arch/x86/lib/cache-smp.c
··· 15 15 16 16 int wbinvd_on_all_cpus(void) 17 17 { 18 - return on_each_cpu(__wbinvd, NULL, 1); 18 + on_each_cpu(__wbinvd, NULL, 1); 19 + return 0; 19 20 } 20 21 EXPORT_SYMBOL(wbinvd_on_all_cpus);
+1 -2
drivers/char/agp/generic.c
··· 1311 1311 1312 1312 void global_cache_flush(void) 1313 1313 { 1314 - if (on_each_cpu(ipi_handler, NULL, 1) != 0) 1315 - panic(PFX "timed out waiting for the other CPUs!\n"); 1314 + on_each_cpu(ipi_handler, NULL, 1); 1316 1315 } 1317 1316 EXPORT_SYMBOL(global_cache_flush); 1318 1317
+3 -4
include/linux/smp.h
··· 35 35 /* 36 36 * Call a function on all processors 37 37 */ 38 - int on_each_cpu(smp_call_func_t func, void *info, int wait); 38 + void on_each_cpu(smp_call_func_t func, void *info, int wait); 39 39 40 40 /* 41 41 * Call a function on processors specified by mask, which might include ··· 101 101 /* 102 102 * Call a function on all other processors 103 103 */ 104 - int smp_call_function(smp_call_func_t func, void *info, int wait); 104 + void smp_call_function(smp_call_func_t func, void *info, int wait); 105 105 void smp_call_function_many(const struct cpumask *mask, 106 106 smp_call_func_t func, void *info, bool wait); 107 107 ··· 144 144 * These macros fold the SMP functionality into a single CPU system 145 145 */ 146 146 #define raw_smp_processor_id() 0 147 - static inline int up_smp_call_function(smp_call_func_t func, void *info) 147 + static inline void up_smp_call_function(smp_call_func_t func, void *info) 148 148 { 149 - return 0; 150 149 } 151 150 #define smp_call_function(func, info, wait) \ 152 151 (up_smp_call_function(func, info))
+8 -1
kernel/cpu.c
··· 522 522 /* 523 523 * SMT soft disabling on X86 requires to bring the CPU out of the 524 524 * BIOS 'wait for SIPI' state in order to set the CR4.MCE bit. The 525 - * CPU marked itself as booted_once in cpu_notify_starting() so the 525 + * CPU marked itself as booted_once in notify_cpu_starting() so the 526 526 * cpu_smt_allowed() check will now return false if this is not the 527 527 * primary sibling. 528 528 */ ··· 1221 1221 for_each_online_cpu(cpu) { 1222 1222 if (cpu == primary) 1223 1223 continue; 1224 + 1225 + if (pm_wakeup_pending()) { 1226 + pr_info("Wakeup pending. Abort CPU freeze\n"); 1227 + error = -EBUSY; 1228 + break; 1229 + } 1230 + 1224 1231 trace_suspend_resume(TPS("CPU_OFF"), cpu, true); 1225 1232 error = _cpu_down(cpu, 1, CPUHP_OFFLINE); 1226 1233 trace_suspend_resume(TPS("CPU_OFF"), cpu, false);
+4 -8
kernel/smp.c
··· 34 34 cpumask_var_t cpumask_ipi; 35 35 }; 36 36 37 - static DEFINE_PER_CPU_SHARED_ALIGNED(struct call_function_data, cfd_data); 37 + static DEFINE_PER_CPU_ALIGNED(struct call_function_data, cfd_data); 38 38 39 39 static DEFINE_PER_CPU_SHARED_ALIGNED(struct llist_head, call_single_queue); 40 40 ··· 487 487 * You must not call this function with disabled interrupts or from a 488 488 * hardware interrupt handler or from a bottom half handler. 489 489 */ 490 - int smp_call_function(smp_call_func_t func, void *info, int wait) 490 + void smp_call_function(smp_call_func_t func, void *info, int wait) 491 491 { 492 492 preempt_disable(); 493 493 smp_call_function_many(cpu_online_mask, func, info, wait); 494 494 preempt_enable(); 495 - 496 - return 0; 497 495 } 498 496 EXPORT_SYMBOL(smp_call_function); 499 497 ··· 592 594 * early_boot_irqs_disabled is set. Use local_irq_save/restore() instead 593 595 * of local_irq_disable/enable(). 594 596 */ 595 - int on_each_cpu(void (*func) (void *info), void *info, int wait) 597 + void on_each_cpu(void (*func) (void *info), void *info, int wait) 596 598 { 597 599 unsigned long flags; 598 - int ret = 0; 599 600 600 601 preempt_disable(); 601 - ret = smp_call_function(func, info, wait); 602 + smp_call_function(func, info, wait); 602 603 local_irq_save(flags); 603 604 func(info); 604 605 local_irq_restore(flags); 605 606 preempt_enable(); 606 - return ret; 607 607 } 608 608 EXPORT_SYMBOL(on_each_cpu); 609 609
+1 -2
kernel/up.c
··· 35 35 } 36 36 EXPORT_SYMBOL(smp_call_function_single_async); 37 37 38 - int on_each_cpu(smp_call_func_t func, void *info, int wait) 38 + void on_each_cpu(smp_call_func_t func, void *info, int wait) 39 39 { 40 40 unsigned long flags; 41 41 42 42 local_irq_save(flags); 43 43 func(info); 44 44 local_irq_restore(flags); 45 - return 0; 46 45 } 47 46 EXPORT_SYMBOL(on_each_cpu); 48 47