LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Thomas Gleixner <tglx@linutronix.de>, Tejun Heo <tj@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	Faisal Latif <faisal.latif@intel.com>,
	Roland Dreier <roland@kernel.org>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Alessandro Rubini <rubini@cvml.unipv.it>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	Mark Fasheh <mfasheh@suse.com>, Joel Becker <jlbec@evilplan.org>,
	"David S. Miller" <davem@davemloft.net>,
	"John W. Linville" <linville@tuxdriver.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Yong Zhang <yong.zhang0@gmail.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH 4/4] workqueue: Remove now superfluous cancel_delayed_work() calls
Date: Thu, 03 Feb 2011 15:09:44 +0100	[thread overview]
Message-ID: <20110203141548.346089735@chello.nl> (raw)
In-Reply-To: <20110203140940.072679794@chello.nl>

[-- Attachment #1: workqueue-remove-cancel_delayed_work.patch --]
[-- Type: text/plain, Size: 7932 bytes --]

Since queue_delayed_work() can now deal with existing timers, we don't
need to explicitly call cancel_delayed_work() anymore.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Faisal Latif <faisal.latif@intel.com>
Cc: Roland Dreier <roland@kernel.org>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Alessandro Rubini <rubini@ipvvis.unipv.it>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
---
 block/blk-throttle.c                |    5 -----
 drivers/infiniband/hw/nes/nes_hw.c  |    2 --
 drivers/infiniband/hw/nes/nes_nic.c |    2 --
 drivers/input/keyboard/qt2160.c     |    3 ---
 drivers/input/mouse/synaptics_i2c.c |    7 -------
 drivers/misc/bh1770glc.c            |    1 -
 drivers/net/phy/phy.c               |    1 -
 drivers/power/jz4740-battery.c      |    2 --
 fs/nfs/nfs4renewd.c                 |    1 -
 fs/ocfs2/cluster/heartbeat.c        |    1 -
 net/core/dst.c                      |    1 -
 net/rfkill/input.c                  |    1 -
 12 files changed, 27 deletions(-)

Index: linux-2.6/block/blk-throttle.c
===================================================================
--- linux-2.6.orig/block/blk-throttle.c
+++ linux-2.6/block/blk-throttle.c
@@ -814,11 +814,6 @@ void throtl_schedule_delayed_work(struct
 	struct delayed_work *dwork = &td->throtl_work;
 
 	if (total_nr_queued(td) > 0) {
-		/*
-		 * We might have a work scheduled to be executed in future.
-		 * Cancel that and schedule a new one.
-		 */
-		__cancel_delayed_work(dwork);
 		kblockd_schedule_delayed_work(q, dwork, delay);
 		throtl_log(td, "schedule work. delay=%lu jiffies=%lu",
 				delay, jiffies);
Index: linux-2.6/drivers/infiniband/hw/nes/nes_hw.c
===================================================================
--- linux-2.6.orig/drivers/infiniband/hw/nes/nes_hw.c
+++ linux-2.6/drivers/infiniband/hw/nes/nes_hw.c
@@ -2651,8 +2651,6 @@ static void nes_process_mac_intr(struct
 			}
 		}
 		if (nesadapter->phy_type[mac_index] == NES_PHY_TYPE_SFP_D) {
-			if (nesdev->link_recheck)
-				cancel_delayed_work(&nesdev->work);
 			nesdev->link_recheck = 1;
 			schedule_delayed_work(&nesdev->work,
 					      NES_LINK_RECHECK_DELAY);
Index: linux-2.6/drivers/infiniband/hw/nes/nes_nic.c
===================================================================
--- linux-2.6.orig/drivers/infiniband/hw/nes/nes_nic.c
+++ linux-2.6/drivers/infiniband/hw/nes/nes_nic.c
@@ -243,8 +243,6 @@ static int nes_netdev_open(struct net_de
 
 	spin_lock_irqsave(&nesdev->nesadapter->phy_lock, flags);
 	if (nesdev->nesadapter->phy_type[nesdev->mac_index] == NES_PHY_TYPE_SFP_D) {
-		if (nesdev->link_recheck)
-			cancel_delayed_work(&nesdev->work);
 		nesdev->link_recheck = 1;
 		schedule_delayed_work(&nesdev->work, NES_LINK_RECHECK_DELAY);
 	}
Index: linux-2.6/drivers/input/keyboard/qt2160.c
===================================================================
--- linux-2.6.orig/drivers/input/keyboard/qt2160.c
+++ linux-2.6/drivers/input/keyboard/qt2160.c
@@ -155,10 +155,7 @@ static irqreturn_t qt2160_irq(int irq, v
 	unsigned long flags;
 
 	spin_lock_irqsave(&qt2160->lock, flags);
-
-	__cancel_delayed_work(&qt2160->dwork);
 	schedule_delayed_work(&qt2160->dwork, 0);
-
 	spin_unlock_irqrestore(&qt2160->lock, flags);
 
 	return IRQ_HANDLED;
Index: linux-2.6/drivers/input/mouse/synaptics_i2c.c
===================================================================
--- linux-2.6.orig/drivers/input/mouse/synaptics_i2c.c
+++ linux-2.6/drivers/input/mouse/synaptics_i2c.c
@@ -374,14 +374,7 @@ static void synaptics_i2c_reschedule_wor
 	unsigned long flags;
 
 	spin_lock_irqsave(&touch->lock, flags);
-
-	/*
-	 * If work is already scheduled then subsequent schedules will not
-	 * change the scheduled time that's why we have to cancel it first.
-	 */
-	__cancel_delayed_work(&touch->dwork);
 	schedule_delayed_work(&touch->dwork, delay);
-
 	spin_unlock_irqrestore(&touch->lock, flags);
 }
 
Index: linux-2.6/drivers/misc/bh1770glc.c
===================================================================
--- linux-2.6.orig/drivers/misc/bh1770glc.c
+++ linux-2.6/drivers/misc/bh1770glc.c
@@ -636,7 +636,6 @@ static irqreturn_t bh1770_irq(int irq, v
 		 * Simulate missing no-proximity interrupt 50ms after the
 		 * next expected interrupt time.
 		 */
-		cancel_delayed_work_sync(&chip->prox_work);
 		schedule_delayed_work(&chip->prox_work,
 				msecs_to_jiffies(rate + 50));
 	}
Index: linux-2.6/drivers/net/phy/phy.c
===================================================================
--- linux-2.6.orig/drivers/net/phy/phy.c
+++ linux-2.6/drivers/net/phy/phy.c
@@ -677,7 +677,6 @@ static void phy_change(struct work_struc
 		goto irq_enable_err;
 
 	/* reschedule state queue work to run as soon as possible */
-	cancel_delayed_work_sync(&phydev->state_queue);
 	schedule_delayed_work(&phydev->state_queue, 0);
 
 	return;
Index: linux-2.6/drivers/power/jz4740-battery.c
===================================================================
--- linux-2.6.orig/drivers/power/jz4740-battery.c
+++ linux-2.6/drivers/power/jz4740-battery.c
@@ -173,7 +173,6 @@ static void jz_battery_external_power_ch
 {
 	struct jz_battery *jz_battery = psy_to_jz_battery(psy);
 
-	cancel_delayed_work(&jz_battery->work);
 	schedule_delayed_work(&jz_battery->work, 0);
 }
 
@@ -181,7 +180,6 @@ static irqreturn_t jz_battery_charge_irq
 {
 	struct jz_battery *jz_battery = data;
 
-	cancel_delayed_work(&jz_battery->work);
 	schedule_delayed_work(&jz_battery->work, 0);
 
 	return IRQ_HANDLED;
Index: linux-2.6/fs/nfs/nfs4renewd.c
===================================================================
--- linux-2.6.orig/fs/nfs/nfs4renewd.c
+++ linux-2.6/fs/nfs/nfs4renewd.c
@@ -115,7 +115,6 @@ nfs4_schedule_state_renewal(struct nfs_c
 		timeout = 5 * HZ;
 	dprintk("%s: requeueing work. Lease period = %ld\n",
 			__func__, (timeout + HZ - 1) / HZ);
-	cancel_delayed_work(&clp->cl_renewd);
 	schedule_delayed_work(&clp->cl_renewd, timeout);
 	set_bit(NFS_CS_RENEWD, &clp->cl_res_state);
 	spin_unlock(&clp->cl_lock);
Index: linux-2.6/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- linux-2.6.orig/fs/ocfs2/cluster/heartbeat.c
+++ linux-2.6/fs/ocfs2/cluster/heartbeat.c
@@ -332,7 +332,6 @@ static void o2hb_arm_write_timeout(struc
 		clear_bit(reg->hr_region_num, o2hb_failed_region_bitmap);
 		spin_unlock(&o2hb_live_lock);
 	}
-	cancel_delayed_work(&reg->hr_write_timeout_work);
 	reg->hr_last_timeout_start = jiffies;
 	schedule_delayed_work(&reg->hr_write_timeout_work,
 			      msecs_to_jiffies(O2HB_MAX_WRITE_TIMEOUT_MS));
Index: linux-2.6/net/core/dst.c
===================================================================
--- linux-2.6.orig/net/core/dst.c
+++ linux-2.6/net/core/dst.c
@@ -207,7 +207,6 @@ void __dst_free(struct dst_entry *dst)
 	if (dst_garbage.timer_inc > DST_GC_INC) {
 		dst_garbage.timer_inc = DST_GC_INC;
 		dst_garbage.timer_expires = DST_GC_MIN;
-		cancel_delayed_work(&dst_gc_work);
 		schedule_delayed_work(&dst_gc_work, dst_garbage.timer_expires);
 	}
 	spin_unlock_bh(&dst_garbage.lock);
Index: linux-2.6/net/rfkill/input.c
===================================================================
--- linux-2.6.orig/net/rfkill/input.c
+++ linux-2.6/net/rfkill/input.c
@@ -163,7 +163,6 @@ static void rfkill_schedule_global_op(en
 	rfkill_op_pending = true;
 	if (op == RFKILL_GLOBAL_OP_EPO && !rfkill_is_epo_lock_active()) {
 		/* bypass the limiter for EPO */
-		cancel_delayed_work(&rfkill_op_work);
 		schedule_delayed_work(&rfkill_op_work, 0);
 		rfkill_last_scheduled = jiffies;
 	} else



  parent reply	other threads:[~2011-02-03 14:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 14:09 [PATCH 0/4] del_timer_sync() and queue_delayed_work() Peter Zijlstra
2011-02-03 14:09 ` [PATCH 1/4] lockdep, timer: Fix del_timer_sync() annotation Peter Zijlstra
2011-02-03 15:35   ` Thomas Gleixner
2011-02-05  1:07     ` Nick Bowler
2011-02-04  3:28   ` Yong Zhang
2011-02-04  9:34   ` [tip:timers/urgent] " tip-bot for Peter Zijlstra
2011-02-03 14:09 ` [PATCH 2/4] timer: Provide mod_timer_on() Peter Zijlstra
2011-02-03 14:09 ` [PATCH 3/4] workqueue: Use mod_timer for queue_delayed_work() Peter Zijlstra
2011-02-03 14:09 ` Peter Zijlstra [this message]
2011-02-03 16:19   ` [PATCH 4/4] workqueue: Remove now superfluous cancel_delayed_work() calls Tejun Heo
2011-02-03 16:45     ` Dmitry Torokhov
2011-02-03 17:45     ` Peter Zijlstra
2011-02-04 11:13       ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110203141548.346089735@chello.nl \
    --to=a.p.zijlstra@chello.nl \
    --cc=Trond.Myklebust@netapp.com \
    --cc=axboe@kernel.dk \
    --cc=davem@davemloft.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=faisal.latif@intel.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=jlbec@evilplan.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mfasheh@suse.com \
    --cc=roland@kernel.org \
    --cc=rubini@cvml.unipv.it \
    --cc=sean.hefty@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=yong.zhang0@gmail.com \
    --subject='Re: [PATCH 4/4] workqueue: Remove now superfluous cancel_delayed_work() calls' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).