This patch changes calls to synchronize_kernel(), deprecated in the earlier "Deprecate synchronize_kernel, GPL replacement" patch to instead call the new synchronize_rcu() and synchronize_sched() APIs.
Unified · Split
| @@ -36,7 +36,7 @@ static void timer_stop(void) · 35 unmodified lines | ||
| 36 | 36 | { |
| 37 | 37 | enable_timer_nmi_watchdog(); |
| 38 | 38 | unset_nmi_callback(); |
| 39 | − synchronize_kernel(); | |
| 39 | + synchronize_sched(); /* Allow already-started NMIs to complete. */ | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| @@ -45,7 +45,7 @@ int HvLpEvent_unregisterHandler( HvLpEvent_Type eventType ) · 44 unmodified lines | ||
| 45 | 45 | /* We now sleep until all other CPUs have scheduled. This ensures that |
| 46 | 46 | * the deletion is seen by all other CPUs, and that the deleted handler |
| 47 | 47 | * isn't still running on another CPU when we return. */ |
| 48 | − synchronize_kernel(); | |
| 48 | + synchronize_rcu(); | |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | return rc; |
| @@ -838,7 +838,7 @@ int acpi_processor_cst_has_changed (struct acpi_processor *pr) · 837 unmodified lines | ||
| 838 | 838 | |
| 839 | 839 | /* Fall back to the default idle loop */ |
| 840 | 840 | pm_idle = pm_idle_save; |
| 841 | − synchronize_kernel(); | |
| 841 | + synchronize_sched(); /* Relies on interrupts forcing exit from idle. */ | |
| 842 | 842 | |
| 843 | 843 | pr->flags.power = 0; |
| 844 | 844 | result = acpi_processor_get_power_info(pr); |
| @@ -2199,7 +2199,7 @@ static int init_one_smi(int intf_num, struct smi_info **smi) · 2198 unmodified lines | ||
| 2199 | 2199 | /* Wait until we know that we are out of any interrupt |
| 2200 | 2200 | handlers might have been running before we freed the |
| 2201 | 2201 | interrupt. */ |
| 2202 | − synchronize_kernel(); | |
| 2202 | + synchronize_sched(); | |
| 2203 | 2203 | |
| 2204 | 2204 | if (new_smi->si_sm) { |
| 2205 | 2205 | if (new_smi->handlers) |
| @@ -2312,7 +2312,7 @@ static void __exit cleanup_one_si(struct smi_info *to_clean) · 106 unmodified lines | ||
| 2312 | 2312 | /* Wait until we know that we are out of any interrupt |
| 2313 | 2313 | handlers might have been running before we freed the |
| 2314 | 2314 | interrupt. */ |
| 2315 | − synchronize_kernel(); | |
| 2315 | + synchronize_sched(); | |
| 2316 | 2316 | |
| 2317 | 2317 | /* Wait for the timer to stop. This avoids problems with race |
| 2318 | 2318 | conditions removing the timer here. */ |
| @@ -678,7 +678,7 @@ static void atkbd_disconnect(struct serio *serio) · 677 unmodified lines | ||
| 678 | 678 | atkbd_disable(atkbd); |
| 679 | 679 | |
| 680 | 680 | /* make sure we don't have a command in flight */ |
| 681 | − synchronize_kernel(); | |
| 681 | + synchronize_sched(); /* Allow atkbd_interrupt()s to complete. */ | |
| 682 | 682 | flush_scheduled_work(); |
| 683 | 683 | |
| 684 | 684 | device_remove_file(&serio->dev, &atkbd_attr_extra); |
| @@ -355,7 +355,7 @@ static int multipath_remove_disk(mddev_t *mddev, int number) · 354 unmodified lines | ||
| 355 | 355 | goto abort; |
| 356 | 356 | } |
| 357 | 357 | p->rdev = NULL; |
| 358 | − synchronize_kernel(); | |
| 358 | + synchronize_rcu(); | |
| 359 | 359 | if (atomic_read(&rdev->nr_pending)) { |
| 360 | 360 | /* lost the race, try later */ |
| 361 | 361 | err = -EBUSY; |
| @@ -797,7 +797,7 @@ static int raid1_remove_disk(mddev_t *mddev, int number) · 796 unmodified lines | ||
| 797 | 797 | goto abort; |
| 798 | 798 | } |
| 799 | 799 | p->rdev = NULL; |
| 800 | − synchronize_kernel(); | |
| 800 | + synchronize_rcu(); | |
| 801 | 801 | if (atomic_read(&rdev->nr_pending)) { |
| 802 | 802 | /* lost the race, try later */ |
| 803 | 803 | err = -EBUSY; |
| @@ -977,7 +977,7 @@ static int raid10_remove_disk(mddev_t *mddev, int number) · 976 unmodified lines | ||
| 977 | 977 | goto abort; |
| 978 | 978 | } |
| 979 | 979 | p->rdev = NULL; |
| 980 | − synchronize_kernel(); | |
| 980 | + synchronize_rcu(); | |
| 981 | 981 | if (atomic_read(&rdev->nr_pending)) { |
| 982 | 982 | /* lost the race, try later */ |
| 983 | 983 | err = -EBUSY; |
| @@ -1873,7 +1873,7 @@ static int raid5_remove_disk(mddev_t *mddev, int number) · 1872 unmodified lines | ||
| 1873 | 1873 | goto abort; |
| 1874 | 1874 | } |
| 1875 | 1875 | p->rdev = NULL; |
| 1876 | − synchronize_kernel(); | |
| 1876 | + synchronize_rcu(); | |
| 1877 | 1877 | if (atomic_read(&rdev->nr_pending)) { |
| 1878 | 1878 | /* lost the race, try later */ |
| 1879 | 1879 | err = -EBUSY; |
| @@ -2038,7 +2038,7 @@ static int raid6_remove_disk(mddev_t *mddev, int number) · 2037 unmodified lines | ||
| 2038 | 2038 | goto abort; |
| 2039 | 2039 | } |
| 2040 | 2040 | p->rdev = NULL; |
| 2041 | − synchronize_kernel(); | |
| 2041 | + synchronize_rcu(); | |
| 2042 | 2042 | if (atomic_read(&rdev->nr_pending)) { |
| 2043 | 2043 | /* lost the race, try later */ |
| 2044 | 2044 | err = -EBUSY; |
| @@ -2385,7 +2385,7 @@ core_down: · 2384 unmodified lines | ||
| 2385 | 2385 | } |
| 2386 | 2386 | |
| 2387 | 2387 | /* Give a racing hard_start_xmit a few cycles to complete. */ |
| 2388 | − synchronize_kernel(); | |
| 2388 | + synchronize_sched(); /* FIXME: should this be synchronize_irq()? */ | |
| 2389 | 2389 | |
| 2390 | 2390 | /* |
| 2391 | 2391 | * And now for the 50k$ question: are IRQ disabled or not ? |
| @@ -45,7 +45,7 @@ s390_register_adapter_interrupt (adapter_int_handler_t handler) · 44 unmodified lines | ||
| 45 | 45 | else |
| 46 | 46 | ret = (cmpxchg(&adapter_handler, NULL, handler) ? -EBUSY : 0); |
| 47 | 47 | if (!ret) |
| 48 | − synchronize_kernel(); | |
| 48 | + synchronize_sched(); /* Allow interrupts to complete. */ | |
| 49 | 49 | |
| 50 | 50 | sprintf (dbf_txt, "ret:%d", ret); |
| 51 | 51 | CIO_TRACE_EVENT (4, dbf_txt); |
| @@ -65,7 +65,7 @@ s390_unregister_adapter_interrupt (adapter_int_handler_t handler) · 13 unmodified lines | ||
| 65 | 65 | ret = -EINVAL; |
| 66 | 66 | else { |
| 67 | 67 | adapter_handler = NULL; |
| 68 | − synchronize_kernel(); | |
| 68 | + synchronize_sched(); /* Allow interrupts to complete. */ | |
| 69 | 69 | ret = 0; |
| 70 | 70 | } |
| 71 | 71 | sprintf (dbf_txt, "ret:%d", ret); |
| @@ -1801,7 +1801,7 @@ sys_init_module(void __user *umod, · 1800 unmodified lines | ||
| 1801 | 1801 | /* Init routine failed: abort. Try to protect us from |
| 1802 | 1802 | buggy refcounters. */ |
| 1803 | 1803 | mod->state = MODULE_STATE_GOING; |
| 1804 | − synchronize_kernel(); | |
| 1804 | + synchronize_sched(); | |
| 1805 | 1805 | if (mod->unsafe) |
| 1806 | 1806 | printk(KERN_ERR "%s: module is now stuck!\n", |
| 1807 | 1807 | mod->name); |
| @@ -184,7 +184,7 @@ void unregister_timer_hook(int (*hook)(struct pt_regs *)) · 183 unmodified lines | ||
| 184 | 184 | WARN_ON(hook != timer_hook); |
| 185 | 185 | timer_hook = NULL; |
| 186 | 186 | /* make sure all CPUs see the NULL hook */ |
| 187 | − synchronize_kernel(); | |
| 187 | + synchronize_sched(); /* Allow ongoing interrupts to complete. */ | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | EXPORT_SYMBOL_GPL(register_timer_hook); |
| @@ -1666,7 +1666,7 @@ int kmem_cache_destroy(kmem_cache_t * cachep) · 1665 unmodified lines | ||
| 1666 | 1666 | } |
| 1667 | 1667 | |
| 1668 | 1668 | if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU)) |
| 1669 | − synchronize_kernel(); | |
| 1669 | + synchronize_rcu(); | |
| 1670 | 1670 | |
| 1671 | 1671 | /* no cpu_online check required here since we clear the percpu |
| 1672 | 1672 | * array on cpu offline and set this to NULL. |
| @@ -3091,7 +3091,7 @@ void free_netdev(struct net_device *dev) · 3090 unmodified lines | ||
| 3091 | 3091 | void synchronize_net(void) |
| 3092 | 3092 | { |
| 3093 | 3093 | might_sleep(); |
| 3094 | − synchronize_kernel(); | |
| 3094 | + synchronize_rcu(); | |
| 3095 | 3095 | } |
| 3096 | 3096 | |
| 3097 | 3097 | /** |