void zcomp_destroy(struct zcomp *comp) { unsigned long cpu; cpu_notifier_register_begin(); for_each_online_cpu(cpu) __zcomp_cpu_notifier(comp, CPU_UP_CANCELED, cpu); __unregister_cpu_notifier(&comp->notifier); cpu_notifier_register_done(); free_percpu(comp->stream); kfree(comp); }
static void nmi_timer_shutdown(void) { struct perf_event *event; int cpu; cpu_notifier_register_begin(); __unregister_cpu_notifier(&nmi_timer_cpu_nb); for_each_possible_cpu(cpu) { event = per_cpu(nmi_timer_events, cpu); if (!event) continue; perf_event_disable(event); per_cpu(nmi_timer_events, cpu) = NULL; perf_event_release_kernel(event); } cpu_notifier_register_done(); }
static void nmi_shutdown(void) { struct op_msrs *msrs; cpu_notifier_register_begin(); /* Use get/put_online_cpus() to protect 'nmi_enabled' & 'ctr_running' */ get_online_cpus(); on_each_cpu(nmi_cpu_shutdown, NULL, 1); nmi_enabled = 0; ctr_running = 0; __unregister_cpu_notifier(&oprofile_cpu_nb); put_online_cpus(); cpu_notifier_register_done(); /* make variables visible to the nmi handler: */ smp_mb(); unregister_nmi_handler(NMI_LOCAL, "oprofile"); msrs = &get_cpu_var(cpu_msrs); model->shutdown(msrs); free_msrs(); put_cpu_var(cpu_msrs); }