Clean up on_each_cpu: should not fail, should not have "retry" arg
Subsystems (16)
PATCH 1/1 Clean up on_each_cpu: should not fail, should not have "retry" arg
Summary: on_each_cpu() should return void, since callers can't do anything useful with an error. It should not have the "retry" arg since it's of questionable utility and simply adds to Kernel Trivial Persuit.
Only Alpha and PA-RISC use the "retry" arg to smp_call_function (it makes them return -EBUSY if another smp_call_function is in progress). This option seems useless outside arch-specific code, and is set fairly randomly by callers.
Otherwise, the return value can be non-zero when a cpu is stuck, but only for ARM and CRIS (-ETIMEDOUT), ppc and powerpc (-1). Sparc64 and PA-RISC also check for timeouts, but still return 0.
No arch-indep code checks the return from on_each_cpu() other than AGP (which panics: what else can you do?). Kudos to IA64 and Alpha for checking the return value when it can never be non-zero! Powerpc does actually check in one place where a timeout could happen, but it looks like the machine is borked at that point anyway since some CPUs are likely spinning in rtas_percpu_suspend_me.
Finally, either slub.c's flush_all() can be called with interrupts disabled on UP, or the #ifdef is gratuitous. I assumed the latter.
Documentation/local_ops.txt +1 -1
@@ -126,7 +126,7 @@ static void do_test_timer(unsigned long int cpu; /* Increment the counters */ - on_each_cpu(test_each, NULL, 0, 1); + on_each_cpu(test_each, NULL, 1); /* Read all the counters */ printk("Counters read from CPU %d\n", smp_processor_id()); for_each_online_cpu(cpu) {
arch/alpha/kernel/process.c +1 -1
@@ -161,7 +161,7 @@ common_shutdown(int mode, char *restart_struct halt_info args; args.mode = mode; args.restart_cmd = restart_cmd; -on_each_cpu (common_shutdown_1, &args,1 ,0 ); +on_each_cpu (common_shutdown_1, &args,0 ); }void
arch/alpha/kernel/smp.c +2 -5
@@ -811,8 +811,7 @@ voidsmp_imb (void) {/* Must wait other processors to flush their icache before continue. */ -if (on_each_cpu (ipi_imb,NULL ,1 ,1 )) -printk (KERN_CRIT "smp_imb: timed out\n" ); +on_each_cpu (ipi_imb,NULL ,1 ); }EXPORT_SYMBOL (smp_imb);
@@ -827,9 +826,7 @@ flush_tlb_all(void) {/* Although we don't have any data to pass, we do want to synchronize with the other processors. */ -if (on_each_cpu (ipi_flush_tlb_all,NULL ,1 ,1 )) { -printk (KERN_CRIT "flush_tlb_all: timed out\n" ); - } +on_each_cpu (ipi_flush_tlb_all,NULL ,1 ); }#define asn_locked () (cpu_data[smp_processor_id()].asn_lock)
arch/arm/kernel/smp.c +3 -3
@@ -705,7 +705,7 @@ static inline void ipi_flush_tlb_kernel_void flush_tlb_all (void ) { -on_each_cpu (ipi_flush_tlb_all,NULL ,1 ,1 ); +on_each_cpu (ipi_flush_tlb_all,NULL ,1 ); }void flush_tlb_mm (struct mm_struct *mm)
@@ -732,7 +732,7 @@ void flush_tlb_kernel_page(unsigned long ta.ta_start = kaddr; -on_each_cpu (ipi_flush_tlb_kernel_page, &ta,1 ,1 ); +on_each_cpu (ipi_flush_tlb_kernel_page, &ta,1 ); } void flush_tlb_range(struct vm_area_struct *vma,
@@ -755,5 +755,5 @@ void flush_tlb_kernel_range(unsigned lon ta.ta_start = start; ta.ta_end = end; -on_each_cpu (ipi_flush_tlb_kernel_range, &ta,1 ,1 ); +on_each_cpu (ipi_flush_tlb_kernel_range, &ta,1 ); }
arch/i386/kernel/cpu/mcheck/non-fatal.c +1 -1
@@ -56,7 +56,7 @@ static DECLARE_DELAYED_WORK(mce_work, mcstatic void mce_work_fn (struct work_struct *work) { -on_each_cpu (mce_checkregs,NULL ,1 ,1 ); +on_each_cpu (mce_checkregs,NULL ,1 );schedule_delayed_work (&mce_work,MCE_RATE ); }
arch/i386/kernel/cpu/perfctr-watchdog.c +2 -2
@@ -173,7 +173,7 @@ void disable_lapic_nmi_watchdog(void)if (atomic_read (&nmi_active) <=0 )return ; -on_each_cpu (stop_apic_nmi_watchdog,NULL ,0 ,1 ); +on_each_cpu (stop_apic_nmi_watchdog,NULL ,1 ); wd_ops->unreserve ();BUG_ON (atomic_read (&nmi_active) !=0 );
@@ -195,7 +195,7 @@ void enable_lapic_nmi_watchdog(void)return ; } -on_each_cpu (setup_apic_nmi_watchdog,NULL ,0 ,1 ); +on_each_cpu (setup_apic_nmi_watchdog,NULL ,1 );touch_nmi_watchdog (); }
arch/i386/kernel/io_apic.c +2 -2
@@ -1624,7 +1624,7 @@ void /*__init*/ print_local_APIC(void *void print_all_local_APICs (void ) { -on_each_cpu (print_local_APIC,NULL ,1 ,1 ); +on_each_cpu (print_local_APIC,NULL ,1 ); }void /*__init*/ print_PIC (void )
@@ -2113,7 +2113,7 @@ static void setup_nmi (void)*/ apic_printk (APIC_VERBOSE ,KERN_INFO "activating NMI Watchdog ..." ); -on_each_cpu (enable_NMI_through_LVT0,NULL ,1 ,1 ); +on_each_cpu (enable_NMI_through_LVT0,NULL ,1 );apic_printk (APIC_VERBOSE ," done.\n" ); }
arch/i386/kernel/nmi.c +2 -2
@@ -221,7 +221,7 @@ static void __acpi_nmi_enable(void *__unvoid acpi_nmi_enable (void ) {if (atomic_read (&nmi_active) && nmi_watchdog ==NMI_IO_APIC ) -on_each_cpu (__acpi_nmi_enable,NULL ,0 ,1 ); +on_each_cpu (__acpi_nmi_enable,NULL ,1 ); }static void __acpi_nmi_disable (void *__unused)
@@ -235,7 +235,7 @@ static void __acpi_nmi_disable(void *__uvoid acpi_nmi_disable (void ) {if (atomic_read (&nmi_active) && nmi_watchdog ==NMI_IO_APIC ) -on_each_cpu (__acpi_nmi_disable,NULL ,0 ,1 ); +on_each_cpu (__acpi_nmi_disable,NULL ,1 ); }void setup_apic_nmi_watchdog (void *unused)
arch/i386/kernel/smp.c +1 -1
@@ -460,7 +460,7 @@ static void do_flush_tlb_all(void* info)void flush_tlb_all (void ) { -on_each_cpu (do_flush_tlb_all,NULL ,1 ,1 ); +on_each_cpu (do_flush_tlb_all,NULL ,1 ); }/*
arch/i386/mach-voyager/voyager_smp.c +1 -1
@@ -1185,7 +1185,7 @@ do_flush_tlb_all(void* info)void flush_tlb_all (void ) { -on_each_cpu (do_flush_tlb_all,0 ,1 ,1 ); +on_each_cpu (do_flush_tlb_all,0 ,1 ); }/* used to set up the trampoline for other CPUs when the memory manager
arch/i386/mm/pageattr.c +1 -1
@@ -192,7 +192,7 @@ __change_page_attr(struct page *page, pgstatic inline void flush_map (struct list_head *l) { -on_each_cpu (flush_kernel_map, l,1 ,1 ); +on_each_cpu (flush_kernel_map, l,1 ); }/*
arch/i386/oprofile/nmi_int.c +5 -5
@@ -220,8 +220,8 @@ static int nmi_setup(void) } } -on_each_cpu (nmi_save_registers,NULL ,0 ,1 ); -on_each_cpu (nmi_cpu_setup,NULL ,0 ,1 ); +on_each_cpu (nmi_save_registers,NULL ,1 ); +on_each_cpu (nmi_cpu_setup,NULL ,1 ); nmi_enabled =1 ;return 0 ; }
@@ -276,7 +276,7 @@ static void nmi_cpu_shutdown(void * dummstatic void nmi_shutdown (void ) { nmi_enabled =0 ; -on_each_cpu (nmi_cpu_shutdown,NULL ,0 ,1 ); +on_each_cpu (nmi_cpu_shutdown,NULL ,1 );unregister_die_notifier (&profile_exceptions_nb);free_msrs (); }
@@ -291,7 +291,7 @@ static void nmi_cpu_start(void * dummy)static int nmi_start (void ) { -on_each_cpu (nmi_cpu_start,NULL ,0 ,1 ); +on_each_cpu (nmi_cpu_start,NULL ,1 );return 0 ; }
@@ -305,7 +305,7 @@ static void nmi_cpu_stop(void * dummy)static void nmi_stop (void ) { -on_each_cpu (nmi_cpu_stop,NULL ,0 ,1 ); +on_each_cpu (nmi_cpu_stop,NULL ,1 ); }
arch/ia64/kernel/mca.c +2 -2
@@ -683,7 +683,7 @@ ia64_mca_cmc_vector_enable (void *dummy)static void ia64_mca_cmc_vector_disable_keventd (struct work_struct *unused) { -on_each_cpu (ia64_mca_cmc_vector_disable,NULL ,1 ,0 ); +on_each_cpu (ia64_mca_cmc_vector_disable,NULL ,0 ); }/*
@@ -695,7 +695,7 @@ ia64_mca_cmc_vector_disable_keventd(strustatic void ia64_mca_cmc_vector_enable_keventd (struct work_struct *unused) { -on_each_cpu (ia64_mca_cmc_vector_enable,NULL ,1 ,0 ); +on_each_cpu (ia64_mca_cmc_vector_enable,NULL ,0 ); }/*
arch/ia64/kernel/perfmon.c +2 -10
@@ -6548,11 +6548,7 @@ pfm_install_alt_pmu_interrupt(pfm_intr_h }/* save the current system wide pmu states */ - ret =on_each_cpu (pfm_alt_save_pmu_state,NULL ,0 ,1 ); -if (ret) { -DPRINT (("on_each_cpu() failed: %d\n" , ret)); - goto cleanup_reserve; - } +on_each_cpu (pfm_alt_save_pmu_state,NULL ,1 );/* officially change to the alternate interrupt handler */ pfm_alt_intr_handler = hdl;
@@ -6579,7 +6575,6 @@ int pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl) {int i; -int ret;if (hdl ==NULL )return -EINVAL ;
@@ -6593,10 +6588,7 @@ pfm_remove_alt_pmu_interrupt(pfm_intr_ha pfm_alt_intr_handler =NULL ; - ret =on_each_cpu (pfm_alt_restore_pmu_state,NULL ,0 ,1 ); -if (ret) { -DPRINT (("on_each_cpu() failed: %d\n" , ret)); - } +on_each_cpu (pfm_alt_restore_pmu_state,NULL ,1 );for_each_online_cpu (i) {pfm_unreserve_session (NULL ,1 , i);
arch/ia64/kernel/smp.c +2 -2
@@ -319,7 +319,7 @@ smp_flush_tlb_cpumask(cpumask_t xcpumaskvoid smp_flush_tlb_all (void ) { -on_each_cpu ((void (*)(void *))local_flush_tlb_all,NULL ,1 ,1 ); +on_each_cpu ((void (*)(void *))local_flush_tlb_all,NULL ,1 ); }void
@@ -342,7 +342,7 @@ smp_flush_tlb_mm (struct mm_struct *mm)* anyhow, and once a CPU is interrupted, the cost of local_flush_tlb_all() is * rather trivial. */ -on_each_cpu ((void (*)(void *))local_finish_flush_tlb_mm, mm,1 ,1 ); +on_each_cpu ((void (*)(void *))local_finish_flush_tlb_mm, mm,1 ); }/*
arch/mips/kernel/irq-rm9000.c +2 -2
@@ -49,7 +49,7 @@ static void local_rm9k_perfcounter_irq_sstatic unsigned int rm9k_perfcounter_irq_startup (unsigned int irq) { -on_each_cpu (local_rm9k_perfcounter_irq_startup, (void *) irq,0 ,1 ); +on_each_cpu (local_rm9k_perfcounter_irq_startup, (void *) irq,1 );return 0 ; }
@@ -66,7 +66,7 @@ static void local_rm9k_perfcounter_irq_sstatic void rm9k_perfcounter_irq_shutdown (unsigned int irq) { -on_each_cpu (local_rm9k_perfcounter_irq_shutdown, (void *) irq,0 ,1 ); +on_each_cpu (local_rm9k_perfcounter_irq_shutdown, (void *) irq,1 ); }static struct irq_chip rm9k_irq_controller = {
arch/mips/kernel/smp.c +2 -2
@@ -282,7 +282,7 @@ static void flush_tlb_all_ipi(void *infovoid flush_tlb_all (void ) { -on_each_cpu (flush_tlb_all_ipi,NULL ,1 ,1 ); +on_each_cpu (flush_tlb_all_ipi,NULL ,1 ); }static void flush_tlb_mm_ipi (void *mm)
@@ -394,7 +394,7 @@ void flush_tlb_kernel_range(unsigned lon fd.addr1 = start; fd.addr2 = end; -on_each_cpu (flush_tlb_kernel_range_ipi, (void *)&fd,1 ,1 ); +on_each_cpu (flush_tlb_kernel_range_ipi, (void *)&fd,1 ); }static void flush_tlb_page_ipi (void *info)
arch/mips/mm/c-sb1.c +1 -1
@@ -256,7 +256,7 @@ static void sb1_flush_cache_data_page(unif (in_atomic ())__sb1_writeback_inv_dcache_range (addr, addr +PAGE_SIZE );else - on_each_cpu(sb1_flush_cache_data_page_ipi, (void *) addr, 1, 1); + on_each_cpu(sb1_flush_cache_data_page_ipi, (void *) addr, 1); }#else
arch/mips/oprofile/common.c +3 -3
@@ -27,7 +27,7 @@ static int op_mips_setup(void) model->reg_setup (ctr);/* Configure the registers on all cpus. */ -on_each_cpu (model->cpu_setup,NULL ,0 ,1 ); +on_each_cpu (model->cpu_setup,NULL ,1 );return 0 ; }
@@ -58,7 +58,7 @@ static int op_mips_create_files(struct sstatic int op_mips_start (void ) { -on_each_cpu (model->cpu_start,NULL ,0 ,1 ); +on_each_cpu (model->cpu_start,NULL ,1 );return 0 ; }
@@ -66,7 +66,7 @@ static int op_mips_start(void)static void op_mips_stop (void ) {/* Disable performance monitoring for all counters. */ -on_each_cpu (model->cpu_stop,NULL ,0 ,1 ); +on_each_cpu (model->cpu_stop,NULL ,1 ); }int __init oprofile_arch_init (struct oprofile_operations *ops)
arch/parisc/kernel/cache.c +3 -3
@@ -51,12 +51,12 @@ static struct pdc_btlb_info btlb_info __void flush_data_cache (void ) { -on_each_cpu (flush_data_cache_local,NULL ,1 ,1 ); +on_each_cpu (flush_data_cache_local,NULL ,1 ); }void flush_instruction_cache (void ) { -on_each_cpu (flush_instruction_cache_local,NULL ,1 ,1 ); +on_each_cpu (flush_instruction_cache_local,NULL ,1 ); }#endif
@@ -515,7 +515,7 @@ static void cacheflush_h_tmp_function(vovoid flush_cache_all (void ) { -on_each_cpu (cacheflush_h_tmp_function,NULL ,1 ,1 ); +on_each_cpu (cacheflush_h_tmp_function,NULL ,1 ); }void flush_cache_mm (struct mm_struct *mm)
arch/parisc/kernel/smp.c +1 -1
@@ -383,7 +383,7 @@ EXPORT_SYMBOL(smp_call_function);void smp_flush_tlb_all (void ) { -on_each_cpu (flush_tlb_all_local,NULL ,1 ,1 ); +on_each_cpu (flush_tlb_all_local,NULL ,1 ); }/*
arch/parisc/mm/init.c +1 -1
@@ -1047,7 +1047,7 @@ void flush_tlb_all(void) do_recycle++; }spin_unlock (&sid_lock); -on_each_cpu (flush_tlb_all_local,NULL ,1 ,1 ); +on_each_cpu (flush_tlb_all_local,NULL ,1 );if (do_recycle) {spin_lock (&sid_lock);recycle_sids (recycle_ndirty,recycle_dirty_array);
arch/powerpc/kernel/rtas.c +1 -2
@@ -727,8 +727,7 @@ static int rtas_ibm_suspend_me(struct rt/* Call function on all CPUs. One of us will make the * rtas call */ -if (on_each_cpu (rtas_percpu_suspend_me, &data,1 ,0 )) - data.waiting = -EINVAL ; +on_each_cpu (rtas_percpu_suspend_me, &data,0 );if (data.waiting !=0 )printk (KERN_ERR "Error doing global join\n" );
arch/powerpc/kernel/tau_6xx.c +2 -2
@@ -192,7 +192,7 @@ static void tau_timeout_smp(unsigned lon/* schedule ourselves to be run again */ mod_timer (&tau_timer, jiffies + shrink_timer) ; -on_each_cpu (tau_timeout,NULL ,1 ,0 ); +on_each_cpu (tau_timeout,NULL ,0 ); }/*
@@ -234,7 +234,7 @@ int __init TAU_init(void) tau_timer.expires = jiffies + shrink_timer;add_timer (&tau_timer); -on_each_cpu (TAU_init_smp,NULL ,1 ,0 ); +on_each_cpu (TAU_init_smp,NULL ,0 );printk ("Thermal assist unit " );#ifdef CONFIG_TAU_INT
arch/powerpc/kernel/time.c +1 -1
@@ -252,7 +252,7 @@ void snapshot_timebases(void) {if (!cpu_has_feature (CPU_FTR_PURR ))return ; -on_each_cpu (snapshot_tb_and_purr,NULL ,0 ,1 ); +on_each_cpu (snapshot_tb_and_purr,NULL ,1 ); }/*
arch/powerpc/mm/slice.c +1 -1
@@ -218,7 +218,7 @@ static void slice_convert(struct mm_strumb ();/* XXX this is sub-optimal but will do for now */ -on_each_cpu (slice_flush_segments, mm,0 ,1 ); +on_each_cpu (slice_flush_segments, mm,1 );#ifdef CONFIG_SPU_BASE spu_flush_all_slbs (mm);#endif
arch/powerpc/oprofile/common.c +3 -3
@@ -52,7 +52,7 @@ static int op_powerpc_setup(void) model->reg_setup (ctr, &sys, model->num_counters);/* Configure the registers on all cpus. */ -on_each_cpu (op_powerpc_cpu_setup,NULL ,0 ,1 ); +on_each_cpu (op_powerpc_cpu_setup,NULL ,1 );return 0 ; }
@@ -72,7 +72,7 @@ static int op_powerpc_start(void)if (model->global_start) model->global_start (ctr);if (model->start) -on_each_cpu (op_powerpc_cpu_start,NULL ,0 ,1 ); +on_each_cpu (op_powerpc_cpu_start,NULL ,1 );return 0 ; }
@@ -84,7 +84,7 @@ static inline void op_powerpc_cpu_stop(vstatic void op_powerpc_stop (void ) {if (model->stop) -on_each_cpu (op_powerpc_cpu_stop,NULL ,0 ,1 ); +on_each_cpu (op_powerpc_cpu_stop,NULL ,1 );if (model->global_stop) model->global_stop (); }
arch/s390/kernel/smp.c +3 -3
@@ -333,7 +333,7 @@ void smp_ptlb_callback(void *info)void smp_ptlb_all (void ) { -on_each_cpu (smp_ptlb_callback,NULL ,0 ,1 ); +on_each_cpu (smp_ptlb_callback,NULL ,1 ); }EXPORT_SYMBOL (smp_ptlb_all);#endif /* ! CONFIG_64BIT */
@@ -381,7 +381,7 @@ void smp_ctl_set_bit(int cr, int bit)memset (&parms.orvals,0 ,sizeof (parms.orvals));memset (&parms.andvals,0xff ,sizeof (parms.andvals)); parms.orvals[cr] =1 << bit; -on_each_cpu (smp_ctl_bit_callback, &parms,0 ,1 ); +on_each_cpu (smp_ctl_bit_callback, &parms,1 ); }EXPORT_SYMBOL (smp_ctl_set_bit);
@@ -395,7 +395,7 @@ void smp_ctl_clear_bit(int cr, int bit)memset (&parms.orvals,0 ,sizeof (parms.orvals));memset (&parms.andvals,0xff ,sizeof (parms.andvals)); parms.andvals[cr] = ~(1L << bit); -on_each_cpu (smp_ctl_bit_callback, &parms,0 ,1 ); +on_each_cpu (smp_ctl_bit_callback, &parms,1 ); }EXPORT_SYMBOL (smp_ctl_clear_bit);
arch/s390/kernel/time.c +1 -1
@@ -1026,7 +1026,7 @@ static void etr_work_fn(struct work_struif (!eacr.ea) {/* Both ports offline. Reset everything. */ eacr.dp = eacr.es = eacr.sl =0 ; -on_each_cpu (etr_disable_sync_clock,NULL ,0 ,1 ); +on_each_cpu (etr_disable_sync_clock,NULL ,1 );del_timer_sync (&etr_timer);etr_update_eacr (eacr);set_bit (ETR_FLAG_EACCES , &etr_flags);
arch/sparc64/mm/hugetlbpage.c +1 -1
@@ -344,7 +344,7 @@ void hugetlb_prefault_arch_hook(struct m* also executing in this address space. */ mm->context.sparc64_ctx_val = ctx; -on_each_cpu (context_reload, mm,0 ,0 ); +on_each_cpu (context_reload, mm,0 ); }spin_unlock (&ctx_alloc_lock); }
arch/x86_64/kernel/io_apic.c +1 -1
@@ -1102,7 +1102,7 @@ void __apicdebuginit print_local_APIC(vovoid print_all_local_APICs (void ) { -on_each_cpu (print_local_APIC,NULL ,1 ,1 ); +on_each_cpu (print_local_APIC,NULL ,1 ); } void __apicdebuginit print_PIC(void)
arch/x86_64/kernel/mce.c +3 -3
@@ -341,7 +341,7 @@ static void mcheck_check_cpu(void *info)static void mcheck_timer (struct work_struct *work) { -on_each_cpu (mcheck_check_cpu,NULL ,1 ,1 ); +on_each_cpu (mcheck_check_cpu,NULL ,1 );/* * It's ok to read stale data here for notify_user and
@@ -517,7 +517,7 @@ static ssize_t mce_read(struct file *fil/* Collect entries that were still getting written before the synchronize. */ -on_each_cpu (collect_tscs, cpu_tsc,1 ,1 ); +on_each_cpu (collect_tscs, cpu_tsc,1 );for (i = next; i <MCE_LOG_LEN ; i++) {if (mcelog.entry[i].finished && mcelog.entry[i].tsc < cpu_tsc[mcelog.entry[i].cpu]) {
@@ -617,7 +617,7 @@ static void mce_restart(void)if (next_interval)cancel_delayed_work (&mcheck_work);/* Timer race is harmless here */ -on_each_cpu (mce_init,NULL ,1 ,1 ); +on_each_cpu (mce_init,NULL ,1 ); next_interval = check_interval *HZ ;if (next_interval)schedule_delayed_work (&mcheck_work, next_interval);
arch/x86_64/kernel/nmi.c +2 -2
@@ -172,7 +172,7 @@ static void __acpi_nmi_disable(void *__uvoid acpi_nmi_disable (void ) {if (atomic_read (&nmi_active) && nmi_watchdog ==NMI_IO_APIC ) -on_each_cpu (__acpi_nmi_disable,NULL ,0 ,1 ); +on_each_cpu (__acpi_nmi_disable,NULL ,1 ); }static void __acpi_nmi_enable (void *__unused)
@@ -186,7 +186,7 @@ static void __acpi_nmi_enable(void *__unvoid acpi_nmi_enable (void ) {if (atomic_read (&nmi_active) && nmi_watchdog ==NMI_IO_APIC ) -on_each_cpu (__acpi_nmi_enable,NULL ,0 ,1 ); +on_each_cpu (__acpi_nmi_enable,NULL ,1 ); }#ifdef CONFIG_PM
arch/x86_64/kernel/smp.c +1 -1
@@ -280,7 +280,7 @@ static void do_flush_tlb_all(void* info)void flush_tlb_all (void ) { -on_each_cpu (do_flush_tlb_all,NULL ,1 ,1 ); +on_each_cpu (do_flush_tlb_all,NULL ,1 ); }/*
arch/x86_64/kernel/vsyscall.c +1 -1
@@ -355,7 +355,7 @@ static int __init vsyscall_init(void)#ifdef CONFIG_SYSCTL register_sysctl_table (kernel_root_table2);#endif -on_each_cpu (cpu_vsyscall_init,NULL ,0 ,1 ); +on_each_cpu (cpu_vsyscall_init,NULL ,1 );hotcpu_notifier (cpu_vsyscall_notifier,0 );return 0 ; }
arch/x86_64/mm/pageattr.c +1 -1
@@ -88,7 +88,7 @@ static void flush_kernel_map(void *arg)static inline void flush_map (struct list_head *l) { -on_each_cpu (flush_kernel_map, l,1 ,1 ); +on_each_cpu (flush_kernel_map, l,1 ); }static LIST_HEAD (deferred_pages);/* protected by init_mm.mmap_sem */
block/blktrace.c +1 -1
@@ -552,7 +552,7 @@ static void blk_trace_set_ht_offsets(voistatic __init int blk_trace_init (void ) {mutex_init (&blk_tree_mutex); -on_each_cpu (blk_trace_check_cpu_time,NULL ,1 ,1 ); +on_each_cpu (blk_trace_check_cpu_time,NULL ,1 );blk_trace_set_ht_offsets ();return 0 ;
drivers/acpi/processor_idle.c +2 -2
@@ -286,9 +286,9 @@ static void acpi_propagate_timer_broadcacpumask_t mask =cpumask_of_cpu (pr->id);if (pr->power.timer_broadcast_on_state <INT_MAX ) -on_each_cpu (switch_APIC_timer_to_ipi, &mask,1 ,1 ); +on_each_cpu (switch_APIC_timer_to_ipi, &mask,1 );else -on_each_cpu (switch_ipi_to_APIC_timer, &mask,1 ,1 ); +on_each_cpu (switch_ipi_to_APIC_timer, &mask,1 );#endif }
drivers/char/agp/generic.c +1 -2
@@ -1228,8 +1228,7 @@ static void ipi_handler(void *null)void global_cache_flush (void ) { -if (on_each_cpu (ipi_handler,NULL ,1 ,1 ) !=0 ) -panic (PFX "timed out waiting for the other CPUs!\n" ); +on_each_cpu (ipi_handler,NULL ,1 ); }EXPORT_SYMBOL (global_cache_flush);
drivers/kvm/kvm_main.c +4 -4
@@ -2934,7 +2934,7 @@ static int kvm_reboot(struct notifier_bl* in vmx root mode. */ printk (KERN_INFO "kvm: exiting hardware virtualization\n" ); -on_each_cpu (hardware_disable,NULL ,0 ,1 ); +on_each_cpu (hardware_disable,NULL ,1 ); }return NOTIFY_OK ; }
@@ -3157,7 +3157,7 @@ int kvm_init_arch(struct kvm_arch_ops *oif (r <0 ) goto out; -on_each_cpu (hardware_enable,NULL ,0 ,1 ); +on_each_cpu (hardware_enable,NULL ,1 ); r =register_cpu_notifier (&kvm_cpu_notifier);if (r) goto out_free_1;
@@ -3189,7 +3189,7 @@ out_free_2:unregister_reboot_notifier (&kvm_reboot_notifier);unregister_cpu_notifier (&kvm_cpu_notifier); out_free_1: -on_each_cpu (hardware_disable,NULL ,0 ,1 ); +on_each_cpu (hardware_disable,NULL ,1 ); kvm_arch_ops->hardware_unsetup (); out: kvm_arch_ops =NULL ;
@@ -3203,7 +3203,7 @@ void kvm_exit_arch(void)sysdev_class_unregister (&kvm_sysdev_class);unregister_reboot_notifier (&kvm_reboot_notifier);unregister_cpu_notifier (&kvm_cpu_notifier); -on_each_cpu (hardware_disable,NULL ,0 ,1 ); +on_each_cpu (hardware_disable,NULL ,1 ); kvm_arch_ops->hardware_unsetup (); kvm_arch_ops =NULL ; }
drivers/kvm/vmx.c +1 -1
@@ -2226,7 +2226,7 @@ static void vmx_inject_page_fault(structstatic void vmx_free_vmcs (struct kvm_vcpu *vcpu) {if (vcpu->vmcs) { -on_each_cpu (__vcpu_clear, vcpu,0 ,1 ); +on_each_cpu (__vcpu_clear, vcpu,1 );free_vmcs (vcpu->vmcs); vcpu->vmcs =NULL ; }
fs/buffer.c +1 -1
@@ -1419,7 +1419,7 @@ static void invalidate_bh_lru(void *arg)void invalidate_bh_lrus (void ) { -on_each_cpu (invalidate_bh_lru,NULL ,1 ,1 ); +on_each_cpu (invalidate_bh_lru,NULL ,1 ); } void set_bh_page(struct buffer_head *bh,
include/linux/smp.h +4 -5
@@ -60,7 +60,7 @@ int smp_call_function_single(int cpuid,/* * Call a function on all processors */ -int on_each_cpu (void (*func) (void *info),void *info,int retry,int wait); +void on_each_cpu (void (*func) (void *info),void *info,int wait);#define MSG_ALL_BUT_SELF 0x8000/* Assume <32768 CPU's */ #define MSG_ALL 0x8001
@@ -89,13 +89,12 @@ static inline int up_smp_call_function(vreturn 0 ; }#define smp_call_function (func,info,retry,wait) (up_smp_call_function()) -#define on_each_cpu (func,info,retry,wait) \ - ({ \ +#define on_each_cpu (func,info,wait) \ + do { \ local_irq_disable(); \ func(info); \ local_irq_enable(); \ - 0; \ - }) + } while(0)static inline void smp_send_reschedule (int cpu) { }#define num_booting_cpus () 1#define smp_prepare_boot_cpu () do {} while (0)
kernel/hrtimer.c +1 -1
@@ -458,7 +458,7 @@ static void retrigger_next_event(void *avoid clock_was_set (void ) {/* Retrigger the CPU local events everywhere */ -on_each_cpu (retrigger_next_event,NULL ,0 ,1 ); +on_each_cpu (retrigger_next_event,NULL ,1 ); }/*
kernel/profile.c +3 -3
@@ -251,7 +251,7 @@ static void profile_flip_buffers(void)mutex_lock (&profile_flip_mutex); j =per_cpu (cpu_profile_flip,get_cpu ());put_cpu (); -on_each_cpu (__profile_flip_buffers,NULL ,0 ,1 ); +on_each_cpu (__profile_flip_buffers,NULL ,1 );for_each_online_cpu (cpu) {struct profile_hit *hits =per_cpu (cpu_profile_hits, cpu)[j];for (i =0 ; i <NR_PROFILE_HIT ; ++i) {
@@ -274,7 +274,7 @@ static void profile_discard_flip_buffersmutex_lock (&profile_flip_mutex); i =per_cpu (cpu_profile_flip,get_cpu ());put_cpu (); -on_each_cpu (__profile_flip_buffers,NULL ,0 ,1 ); +on_each_cpu (__profile_flip_buffers,NULL ,1 );for_each_online_cpu (cpu) {struct profile_hit *hits =per_cpu (cpu_profile_hits, cpu)[i];memset (hits,0 ,NR_PROFILE_HIT *sizeof (struct profile_hit ));
@@ -557,7 +557,7 @@ static int __init create_hash_tables(voi out_cleanup: prof_on =0 ;smp_mb (); -on_each_cpu (profile_nop,NULL ,0 ,1 ); +on_each_cpu (profile_nop,NULL ,1 );for_each_online_cpu (cpu) {struct page *page;
kernel/rcupdate.c +1 -1
@@ -218,7 +218,7 @@ void rcu_barrier(void)mutex_lock (&rcu_barrier_mutex);init_completion (&rcu_barrier_completion);atomic_set (&rcu_barrier_cpu_count,0 ); -on_each_cpu (rcu_barrier_func,NULL ,0 ,1 ); +on_each_cpu (rcu_barrier_func,NULL ,1 );wait_for_completion (&rcu_barrier_completion);mutex_unlock (&rcu_barrier_mutex); }
kernel/softirq.c +2 -5
@@ -647,17 +647,14 @@ __init int spawn_ksoftirqd(void)/* * Call a function on all processors */ -int on_each_cpu (void (*func) (void *info),void *info,int retry,int wait) +void on_each_cpu (void (*func) (void *info),void *info,int wait) { -int ret =0 ; -preempt_disable (); - ret =smp_call_function (func, info, retry, wait); +smp_call_function (func, info,1 , wait);local_irq_disable ();func (info);local_irq_enable ();preempt_enable (); -return ret; }EXPORT_SYMBOL (on_each_cpu);#endif
mm/slab.c +2 -2
@@ -2433,7 +2433,7 @@ static void drain_cpu_caches(struct kmemstruct kmem_list3 *l3;int node; -on_each_cpu (do_drain, cachep,1 ,1 ); +on_each_cpu (do_drain, cachep,1 );check_irq_on ();for_each_online_node (node) { l3 = cachep->nodelists[node];
@@ -3903,7 +3903,7 @@ static int do_tune_cpucache(struct kmem_ } new->cachep = cachep; -on_each_cpu (do_ccupdate_local, (void *)new,1 ,1 ); +on_each_cpu (do_ccupdate_local, (void *)new,1 );check_irq_on (); cachep->batchcount = batchcount;
mm/slub.c +1 -9
@@ -1424,15 +1424,7 @@ static void flush_cpu_slab(void *d)static void flush_all (struct kmem_cache *s) { -#ifdef CONFIG_SMP -on_each_cpu (flush_cpu_slab, s,1 ,1 ); -#else -unsigned long flags; - -local_irq_save (flags); -flush_cpu_slab (s); -local_irq_restore (flags); -#endif +on_each_cpu (flush_cpu_slab, s,1 ); }/*
mm/vmstat.c +1 -1
@@ -365,7 +365,7 @@ static void __refresh_cpu_vm_stats(void*/ void refresh_vm_stats (void ) { -on_each_cpu (__refresh_cpu_vm_stats,NULL ,0 ,1 ); +on_each_cpu (__refresh_cpu_vm_stats,NULL ,1 ); }EXPORT_SYMBOL (refresh_vm_stats);
net/iucv/iucv.c +1 -1
@@ -544,7 +544,7 @@ out:*/ static void iucv_disable (void ) { -on_each_cpu (iucv_retrieve_cpu,NULL ,0 ,1 ); +on_each_cpu (iucv_retrieve_cpu,NULL ,1 );kfree (iucv_path_table); }
Quoted 2 lines · On Thu, 19 Jul 2007 13:07:14 +1000 Rusty Russell <[email protected]> wrote:
Finally, either slub.c's
flush_all()can be called with interrupts disabled on UP, or the #ifdef is gratuitous. I assumed the latter.
Correct. flush_all() is always called with interrupts disabled. So its gratuitous.