aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-08-03 13:30:47 -0400
committerTejun Heo <tj@kernel.org>2012-08-13 19:27:37 -0400
commit41f63c5359d14ca995172b8f6eaffd93f60fec54 (patch)
treed3d93dfd25d2e29e8abeae934835f2266b018cb7
parent8376fe22c7e79c7e90857d39f82aeae6cad6c4b8 (diff)
workqueue: use mod_delayed_work() instead of cancel + queue
Convert delayed_work users doing cancel_delayed_work() followed by queue_delayed_work() to mod_delayed_work(). Most conversions are straight-forward. Ones worth mentioning are, * drivers/edac/edac_mc.c: edac_mc_workq_setup() converted to always use mod_delayed_work() and cancel loop in edac_mc_reset_delay_period() is dropped. * drivers/platform/x86/thinkpad_acpi.c: No need to remember whether watchdog is active or not. @fan_watchdog_active and related code dropped. * drivers/power/charger-manager.c: Seemingly a lot of delayed_work_pending() abuse going on here. [delayed_]work_pending() are unsynchronized and racy when used like this. I converted one instance in fullbatt_handler(). Please conver the rest so that it invokes workqueue APIs for the intended target state rather than trying to game work item pending state transitions. e.g. if timer should be modified - call mod_delayed_work(), canceled - call cancel_delayed_work[_sync](). * drivers/thermal/thermal_sys.c: thermal_zone_device_set_polling() simplified. Note that round_jiffies() calls in this function are meaningless. round_jiffies() work on absolute jiffies not delta delay used by delayed_work. v2: Tomi pointed out that __cancel_delayed_work() users can't be safely converted to mod_delayed_work(). They could be calling it from irq context and if that happens while delayed_work_timer_fn() is running, it could deadlock. __cancel_delayed_work() users are dropped. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com> Acked-by: David Howells <dhowells@redhat.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Doug Thompson <dougthompson@xmission.com> Cc: David Airlie <airlied@linux.ie> Cc: Roland Dreier <roland@kernel.org> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Len Brown <len.brown@intel.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Johannes Berg <johannes@sipsolutions.net>
-rw-r--r--block/genhd.c6
-rw-r--r--drivers/edac/edac_mc.c17
-rw-r--r--drivers/infiniband/core/addr.c4
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c6
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c5
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c8
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c3
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c20
-rw-r--r--drivers/power/charger-manager.c9
-rw-r--r--drivers/power/ds2760_battery.c9
-rw-r--r--drivers/power/jz4740-battery.c6
-rw-r--r--drivers/thermal/thermal_sys.c15
-rw-r--r--fs/afs/callback.c4
-rw-r--r--fs/afs/server.c10
-rw-r--r--fs/afs/vlocation.c14
-rw-r--r--fs/nfs/nfs4renewd.c3
-rw-r--r--net/core/dst.c4
-rw-r--r--net/rfkill/input.c3
18 files changed, 41 insertions, 105 deletions
diff --git a/block/genhd.c b/block/genhd.c
index cac7366957c3..5d8b44a6442b 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1534,10 +1534,8 @@ void disk_flush_events(struct gendisk *disk, unsigned int mask)
1534 1534
1535 spin_lock_irq(&ev->lock); 1535 spin_lock_irq(&ev->lock);
1536 ev->clearing |= mask; 1536 ev->clearing |= mask;
1537 if (!ev->block) { 1537 if (!ev->block)
1538 cancel_delayed_work(&ev->dwork); 1538 mod_delayed_work(system_nrt_freezable_wq, &ev->dwork, 0);
1539 queue_delayed_work(system_nrt_freezable_wq, &ev->dwork, 0);
1540 }
1541 spin_unlock_irq(&ev->lock); 1539 spin_unlock_irq(&ev->lock);
1542} 1540}
1543 1541
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 616d90bcb3a4..7c0df4af9ef7 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -538,7 +538,7 @@ static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec)
538 return; 538 return;
539 539
540 INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function); 540 INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function);
541 queue_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec)); 541 mod_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec));
542} 542}
543 543
544/* 544/*
@@ -578,21 +578,6 @@ void edac_mc_reset_delay_period(int value)
578 578
579 mutex_lock(&mem_ctls_mutex); 579 mutex_lock(&mem_ctls_mutex);
580 580
581 /* scan the list and turn off all workq timers, doing so under lock
582 */
583 list_for_each(item, &mc_devices) {
584 mci = list_entry(item, struct mem_ctl_info, link);
585
586 if (mci->op_state == OP_RUNNING_POLL)
587 cancel_delayed_work(&mci->work);
588 }
589
590 mutex_unlock(&mem_ctls_mutex);
591
592
593 /* re-walk the list, and reset the poll delay */
594 mutex_lock(&mem_ctls_mutex);
595
596 list_for_each(item, &mc_devices) { 581 list_for_each(item, &mc_devices) {
597 mci = list_entry(item, struct mem_ctl_info, link); 582 mci = list_entry(item, struct mem_ctl_info, link);
598 583
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index 28058ae33d38..eaec8d7a3b73 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -152,13 +152,11 @@ static void set_timeout(unsigned long time)
152{ 152{
153 unsigned long delay; 153 unsigned long delay;
154 154
155 cancel_delayed_work(&work);
156
157 delay = time - jiffies; 155 delay = time - jiffies;
158 if ((long)delay <= 0) 156 if ((long)delay <= 0)
159 delay = 1; 157 delay = 1;
160 158
161 queue_delayed_work(addr_wq, &work, delay); 159 mod_delayed_work(addr_wq, &work, delay);
162} 160}
163 161
164static void queue_req(struct addr_req *req) 162static void queue_req(struct addr_req *req)
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index d42c9f435b1b..9e0895b45eb8 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -2679,11 +2679,9 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
2679 } 2679 }
2680 } 2680 }
2681 if (nesadapter->phy_type[mac_index] == NES_PHY_TYPE_SFP_D) { 2681 if (nesadapter->phy_type[mac_index] == NES_PHY_TYPE_SFP_D) {
2682 if (nesdev->link_recheck)
2683 cancel_delayed_work(&nesdev->work);
2684 nesdev->link_recheck = 1; 2682 nesdev->link_recheck = 1;
2685 schedule_delayed_work(&nesdev->work, 2683 mod_delayed_work(system_wq, &nesdev->work,
2686 NES_LINK_RECHECK_DELAY); 2684 NES_LINK_RECHECK_DELAY);
2687 } 2685 }
2688 } 2686 }
2689 2687
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index f3a3ecf8d09e..e43f6e41a6bd 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -243,10 +243,9 @@ static int nes_netdev_open(struct net_device *netdev)
243 243
244 spin_lock_irqsave(&nesdev->nesadapter->phy_lock, flags); 244 spin_lock_irqsave(&nesdev->nesadapter->phy_lock, flags);
245 if (nesdev->nesadapter->phy_type[nesdev->mac_index] == NES_PHY_TYPE_SFP_D) { 245 if (nesdev->nesadapter->phy_type[nesdev->mac_index] == NES_PHY_TYPE_SFP_D) {
246 if (nesdev->link_recheck)
247 cancel_delayed_work(&nesdev->work);
248 nesdev->link_recheck = 1; 246 nesdev->link_recheck = 1;
249 schedule_delayed_work(&nesdev->work, NES_LINK_RECHECK_DELAY); 247 mod_delayed_work(system_wq, &nesdev->work,
248 NES_LINK_RECHECK_DELAY);
250 } 249 }
251 spin_unlock_irqrestore(&nesdev->nesadapter->phy_lock, flags); 250 spin_unlock_irqrestore(&nesdev->nesadapter->phy_lock, flags);
252 251
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 95aa8e1683ec..8a3420257eeb 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -2180,8 +2180,7 @@ static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status)
2180 2180
2181 /* Make sure the RF Kill check timer is running */ 2181 /* Make sure the RF Kill check timer is running */
2182 priv->stop_rf_kill = 0; 2182 priv->stop_rf_kill = 0;
2183 cancel_delayed_work(&priv->rf_kill); 2183 mod_delayed_work(system_wq, &priv->rf_kill, round_jiffies_relative(HZ));
2184 schedule_delayed_work(&priv->rf_kill, round_jiffies_relative(HZ));
2185} 2184}
2186 2185
2187static void send_scan_event(void *data) 2186static void send_scan_event(void *data)
@@ -4321,9 +4320,8 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
4321 "disabled by HW switch\n"); 4320 "disabled by HW switch\n");
4322 /* Make sure the RF_KILL check timer is running */ 4321 /* Make sure the RF_KILL check timer is running */
4323 priv->stop_rf_kill = 0; 4322 priv->stop_rf_kill = 0;
4324 cancel_delayed_work(&priv->rf_kill); 4323 mod_delayed_work(system_wq, &priv->rf_kill,
4325 schedule_delayed_work(&priv->rf_kill, 4324 round_jiffies_relative(HZ));
4326 round_jiffies_relative(HZ));
4327 } else 4325 } else
4328 schedule_reset(priv); 4326 schedule_reset(priv);
4329 } 4327 }
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index af83c43bcdb1..ef2b171e3514 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -1164,8 +1164,7 @@ void zd_usb_reset_rx_idle_timer(struct zd_usb *usb)
1164{ 1164{
1165 struct zd_usb_rx *rx = &usb->rx; 1165 struct zd_usb_rx *rx = &usb->rx;
1166 1166
1167 cancel_delayed_work(&rx->idle_work); 1167 mod_delayed_work(zd_workqueue, &rx->idle_work, ZD_RX_IDLE_INTERVAL);
1168 queue_delayed_work(zd_workqueue, &rx->idle_work, ZD_RX_IDLE_INTERVAL);
1169} 1168}
1170 1169
1171static inline void init_usb_interrupt(struct zd_usb *usb) 1170static inline void init_usb_interrupt(struct zd_usb *usb)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e7f73287636c..06d2502ffb37 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -7682,25 +7682,15 @@ static int fan_set_speed(int speed)
7682 7682
7683static void fan_watchdog_reset(void) 7683static void fan_watchdog_reset(void)
7684{ 7684{
7685 static int fan_watchdog_active;
7686
7687 if (fan_control_access_mode == TPACPI_FAN_WR_NONE) 7685 if (fan_control_access_mode == TPACPI_FAN_WR_NONE)
7688 return; 7686 return;
7689 7687
7690 if (fan_watchdog_active)
7691 cancel_delayed_work(&fan_watchdog_task);
7692
7693 if (fan_watchdog_maxinterval > 0 && 7688 if (fan_watchdog_maxinterval > 0 &&
7694 tpacpi_lifecycle != TPACPI_LIFE_EXITING) { 7689 tpacpi_lifecycle != TPACPI_LIFE_EXITING)
7695 fan_watchdog_active = 1; 7690 mod_delayed_work(tpacpi_wq, &fan_watchdog_task,
7696 if (!queue_delayed_work(tpacpi_wq, &fan_watchdog_task, 7691 msecs_to_jiffies(fan_watchdog_maxinterval * 1000));
7697 msecs_to_jiffies(fan_watchdog_maxinterval 7692 else
7698 * 1000))) { 7693 cancel_delayed_work(&fan_watchdog_task);
7699 pr_err("failed to queue the fan watchdog, "
7700 "watchdog will not trigger\n");
7701 }
7702 } else
7703 fan_watchdog_active = 0;
7704} 7694}
7705 7695
7706static void fan_watchdog_fire(struct work_struct *ignored) 7696static void fan_watchdog_fire(struct work_struct *ignored)
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
index 526e5c931294..7ff83cf43c8c 100644
--- a/drivers/power/charger-manager.c
+++ b/drivers/power/charger-manager.c
@@ -509,9 +509,8 @@ static void _setup_polling(struct work_struct *work)
509 if (!delayed_work_pending(&cm_monitor_work) || 509 if (!delayed_work_pending(&cm_monitor_work) ||
510 (delayed_work_pending(&cm_monitor_work) && 510 (delayed_work_pending(&cm_monitor_work) &&
511 time_after(next_polling, _next_polling))) { 511 time_after(next_polling, _next_polling))) {
512 cancel_delayed_work_sync(&cm_monitor_work);
513 next_polling = jiffies + polling_jiffy; 512 next_polling = jiffies + polling_jiffy;
514 queue_delayed_work(cm_wq, &cm_monitor_work, polling_jiffy); 513 mod_delayed_work(cm_wq, &cm_monitor_work, polling_jiffy);
515 } 514 }
516 515
517out: 516out:
@@ -546,10 +545,8 @@ static void fullbatt_handler(struct charger_manager *cm)
546 if (cm_suspended) 545 if (cm_suspended)
547 device_set_wakeup_capable(cm->dev, true); 546 device_set_wakeup_capable(cm->dev, true);
548 547
549 if (delayed_work_pending(&cm->fullbatt_vchk_work)) 548 mod_delayed_work(cm_wq, &cm->fullbatt_vchk_work,
550 cancel_delayed_work(&cm->fullbatt_vchk_work); 549 msecs_to_jiffies(desc->fullbatt_vchkdrop_ms));
551 queue_delayed_work(cm_wq, &cm->fullbatt_vchk_work,
552 msecs_to_jiffies(desc->fullbatt_vchkdrop_ms));
553 cm->fullbatt_vchk_jiffies_at = jiffies + msecs_to_jiffies( 550 cm->fullbatt_vchk_jiffies_at = jiffies + msecs_to_jiffies(
554 desc->fullbatt_vchkdrop_ms); 551 desc->fullbatt_vchkdrop_ms);
555 552
diff --git a/drivers/power/ds2760_battery.c b/drivers/power/ds2760_battery.c
index 076e211a40b7..704e652072be 100644
--- a/drivers/power/ds2760_battery.c
+++ b/drivers/power/ds2760_battery.c
@@ -355,8 +355,7 @@ static void ds2760_battery_external_power_changed(struct power_supply *psy)
355 355
356 dev_dbg(di->dev, "%s\n", __func__); 356 dev_dbg(di->dev, "%s\n", __func__);
357 357
358 cancel_delayed_work(&di->monitor_work); 358 mod_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ/10);
359 queue_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ/10);
360} 359}
361 360
362 361
@@ -401,8 +400,7 @@ static void ds2760_battery_set_charged(struct power_supply *psy)
401 400
402 /* postpone the actual work by 20 secs. This is for debouncing GPIO 401 /* postpone the actual work by 20 secs. This is for debouncing GPIO
403 * signals and to let the current value settle. See AN4188. */ 402 * signals and to let the current value settle. See AN4188. */
404 cancel_delayed_work(&di->set_charged_work); 403 mod_delayed_work(di->monitor_wqueue, &di->set_charged_work, HZ * 20);
405 queue_delayed_work(di->monitor_wqueue, &di->set_charged_work, HZ * 20);
406} 404}
407 405
408static int ds2760_battery_get_property(struct power_supply *psy, 406static int ds2760_battery_get_property(struct power_supply *psy,
@@ -616,8 +614,7 @@ static int ds2760_battery_resume(struct platform_device *pdev)
616 di->charge_status = POWER_SUPPLY_STATUS_UNKNOWN; 614 di->charge_status = POWER_SUPPLY_STATUS_UNKNOWN;
617 power_supply_changed(&di->bat); 615 power_supply_changed(&di->bat);
618 616
619 cancel_delayed_work(&di->monitor_work); 617 mod_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ);
620 queue_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ);
621 618
622 return 0; 619 return 0;
623} 620}
diff --git a/drivers/power/jz4740-battery.c b/drivers/power/jz4740-battery.c
index 8dbc7bfaab14..ffbed5e5b945 100644
--- a/drivers/power/jz4740-battery.c
+++ b/drivers/power/jz4740-battery.c
@@ -173,16 +173,14 @@ static void jz_battery_external_power_changed(struct power_supply *psy)
173{ 173{
174 struct jz_battery *jz_battery = psy_to_jz_battery(psy); 174 struct jz_battery *jz_battery = psy_to_jz_battery(psy);
175 175
176 cancel_delayed_work(&jz_battery->work); 176 mod_delayed_work(system_wq, &jz_battery->work, 0);
177 schedule_delayed_work(&jz_battery->work, 0);
178} 177}
179 178
180static irqreturn_t jz_battery_charge_irq(int irq, void *data) 179static irqreturn_t jz_battery_charge_irq(int irq, void *data)
181{ 180{
182 struct jz_battery *jz_battery = data; 181 struct jz_battery *jz_battery = data;
183 182
184 cancel_delayed_work(&jz_battery->work); 183 mod_delayed_work(system_wq, &jz_battery->work, 0);
185 schedule_delayed_work(&jz_battery->work, 0);
186 184
187 return IRQ_HANDLED; 185 return IRQ_HANDLED;
188} 186}
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 2ab31e4f02cc..67789b8345d2 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -694,17 +694,14 @@ thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz)
694static void thermal_zone_device_set_polling(struct thermal_zone_device *tz, 694static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
695 int delay) 695 int delay)
696{ 696{
697 cancel_delayed_work(&(tz->poll_queue));
698
699 if (!delay)
700 return;
701
702 if (delay > 1000) 697 if (delay > 1000)
703 queue_delayed_work(system_freezable_wq, &(tz->poll_queue), 698 mod_delayed_work(system_freezable_wq, &tz->poll_queue,
704 round_jiffies(msecs_to_jiffies(delay))); 699 round_jiffies(msecs_to_jiffies(delay)));
700 else if (delay)
701 mod_delayed_work(system_freezable_wq, &tz->poll_queue,
702 msecs_to_jiffies(delay));
705 else 703 else
706 queue_delayed_work(system_freezable_wq, &(tz->poll_queue), 704 cancel_delayed_work(&tz->poll_queue);
707 msecs_to_jiffies(delay));
708} 705}
709 706
710static void thermal_zone_device_passive(struct thermal_zone_device *tz, 707static void thermal_zone_device_passive(struct thermal_zone_device *tz,
diff --git a/fs/afs/callback.c b/fs/afs/callback.c
index 587ef5123cd8..7ef637d7f3a5 100644
--- a/fs/afs/callback.c
+++ b/fs/afs/callback.c
@@ -351,9 +351,7 @@ void afs_dispatch_give_up_callbacks(struct work_struct *work)
351 */ 351 */
352void afs_flush_callback_breaks(struct afs_server *server) 352void afs_flush_callback_breaks(struct afs_server *server)
353{ 353{
354 cancel_delayed_work(&server->cb_break_work); 354 mod_delayed_work(afs_callback_update_worker, &server->cb_break_work, 0);
355 queue_delayed_work(afs_callback_update_worker,
356 &server->cb_break_work, 0);
357} 355}
358 356
359#if 0 357#if 0
diff --git a/fs/afs/server.c b/fs/afs/server.c
index d59b7516e943..f342acf3547d 100644
--- a/fs/afs/server.c
+++ b/fs/afs/server.c
@@ -285,12 +285,7 @@ static void afs_reap_server(struct work_struct *work)
285 expiry = server->time_of_death + afs_server_timeout; 285 expiry = server->time_of_death + afs_server_timeout;
286 if (expiry > now) { 286 if (expiry > now) {
287 delay = (expiry - now) * HZ; 287 delay = (expiry - now) * HZ;
288 if (!queue_delayed_work(afs_wq, &afs_server_reaper, 288 mod_delayed_work(afs_wq, &afs_server_reaper, delay);
289 delay)) {
290 cancel_delayed_work(&afs_server_reaper);
291 queue_delayed_work(afs_wq, &afs_server_reaper,
292 delay);
293 }
294 break; 289 break;
295 } 290 }
296 291
@@ -323,6 +318,5 @@ static void afs_reap_server(struct work_struct *work)
323void __exit afs_purge_servers(void) 318void __exit afs_purge_servers(void)
324{ 319{
325 afs_server_timeout = 0; 320 afs_server_timeout = 0;
326 cancel_delayed_work(&afs_server_reaper); 321 mod_delayed_work(afs_wq, &afs_server_reaper, 0);
327 queue_delayed_work(afs_wq, &afs_server_reaper, 0);
328} 322}
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index 431984d2e372..57bcb1596530 100644
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -561,12 +561,7 @@ static void afs_vlocation_reaper(struct work_struct *work)
561 if (expiry > now) { 561 if (expiry > now) {
562 delay = (expiry - now) * HZ; 562 delay = (expiry - now) * HZ;
563 _debug("delay %lu", delay); 563 _debug("delay %lu", delay);
564 if (!queue_delayed_work(afs_wq, &afs_vlocation_reap, 564 mod_delayed_work(afs_wq, &afs_vlocation_reap, delay);
565 delay)) {
566 cancel_delayed_work(&afs_vlocation_reap);
567 queue_delayed_work(afs_wq, &afs_vlocation_reap,
568 delay);
569 }
570 break; 565 break;
571 } 566 }
572 567
@@ -614,13 +609,10 @@ void afs_vlocation_purge(void)
614 spin_lock(&afs_vlocation_updates_lock); 609 spin_lock(&afs_vlocation_updates_lock);
615 list_del_init(&afs_vlocation_updates); 610 list_del_init(&afs_vlocation_updates);
616 spin_unlock(&afs_vlocation_updates_lock); 611 spin_unlock(&afs_vlocation_updates_lock);
617 cancel_delayed_work(&afs_vlocation_update); 612 mod_delayed_work(afs_vlocation_update_worker, &afs_vlocation_update, 0);
618 queue_delayed_work(afs_vlocation_update_worker,
619 &afs_vlocation_update, 0);
620 destroy_workqueue(afs_vlocation_update_worker); 613 destroy_workqueue(afs_vlocation_update_worker);
621 614
622 cancel_delayed_work(&afs_vlocation_reap); 615 mod_delayed_work(afs_wq, &afs_vlocation_reap, 0);
623 queue_delayed_work(afs_wq, &afs_vlocation_reap, 0);
624} 616}
625 617
626/* 618/*
diff --git a/fs/nfs/nfs4renewd.c b/fs/nfs/nfs4renewd.c
index 6930bec91bca..1720d32ffa54 100644
--- a/fs/nfs/nfs4renewd.c
+++ b/fs/nfs/nfs4renewd.c
@@ -117,8 +117,7 @@ nfs4_schedule_state_renewal(struct nfs_client *clp)
117 timeout = 5 * HZ; 117 timeout = 5 * HZ;
118 dprintk("%s: requeueing work. Lease period = %ld\n", 118 dprintk("%s: requeueing work. Lease period = %ld\n",
119 __func__, (timeout + HZ - 1) / HZ); 119 __func__, (timeout + HZ - 1) / HZ);
120 cancel_delayed_work(&clp->cl_renewd); 120 mod_delayed_work(system_wq, &clp->cl_renewd, timeout);
121 schedule_delayed_work(&clp->cl_renewd, timeout);
122 set_bit(NFS_CS_RENEWD, &clp->cl_res_state); 121 set_bit(NFS_CS_RENEWD, &clp->cl_res_state);
123 spin_unlock(&clp->cl_lock); 122 spin_unlock(&clp->cl_lock);
124} 123}
diff --git a/net/core/dst.c b/net/core/dst.c
index 069d51d29414..ed5a0b409aa3 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -214,8 +214,8 @@ void __dst_free(struct dst_entry *dst)
214 if (dst_garbage.timer_inc > DST_GC_INC) { 214 if (dst_garbage.timer_inc > DST_GC_INC) {
215 dst_garbage.timer_inc = DST_GC_INC; 215 dst_garbage.timer_inc = DST_GC_INC;
216 dst_garbage.timer_expires = DST_GC_MIN; 216 dst_garbage.timer_expires = DST_GC_MIN;
217 cancel_delayed_work(&dst_gc_work); 217 mod_delayed_work(system_wq, &dst_gc_work,
218 schedule_delayed_work(&dst_gc_work, dst_garbage.timer_expires); 218 dst_garbage.timer_expires);
219 } 219 }
220 spin_unlock_bh(&dst_garbage.lock); 220 spin_unlock_bh(&dst_garbage.lock);
221} 221}
diff --git a/net/rfkill/input.c b/net/rfkill/input.c
index 24c55c53e6a2..c9d931e7ffec 100644
--- a/net/rfkill/input.c
+++ b/net/rfkill/input.c
@@ -164,8 +164,7 @@ static void rfkill_schedule_global_op(enum rfkill_sched_op op)
164 rfkill_op_pending = true; 164 rfkill_op_pending = true;
165 if (op == RFKILL_GLOBAL_OP_EPO && !rfkill_is_epo_lock_active()) { 165 if (op == RFKILL_GLOBAL_OP_EPO && !rfkill_is_epo_lock_active()) {
166 /* bypass the limiter for EPO */ 166 /* bypass the limiter for EPO */
167 cancel_delayed_work(&rfkill_op_work); 167 mod_delayed_work(system_wq, &rfkill_op_work, 0);
168 schedule_delayed_work(&rfkill_op_work, 0);
169 rfkill_last_scheduled = jiffies; 168 rfkill_last_scheduled = jiffies;
170 } else 169 } else
171 rfkill_schedule_ratelimited(); 170 rfkill_schedule_ratelimited();