public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block core: use round_jiffies on timer to reduce wakeups
@ 2009-11-11  0:22 Randy Dunlap
  2009-11-11 12:46 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2009-11-11  0:22 UTC (permalink / raw)
  To: lkml, Jens Axboe

From: Randy Dunlap <randy.dunlap@oracle.com>

Use round_jiffies() variant to schedule the timer along with
other timer wakeups on the same CPU.

Source file also needs to include jiffies.h since it uses
functions or macros from it.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 block/blk-core.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- lnx-2632-rc6.orig/block/blk-core.c
+++ lnx-2632-rc6/block/blk-core.c
@@ -17,6 +17,7 @@
 #include <linux/bio.h>
 #include <linux/blkdev.h>
 #include <linux/highmem.h>
+#include <linux/jiffies.h>
 #include <linux/mm.h>
 #include <linux/kernel_stat.h>
 #include <linux/string.h>
@@ -212,7 +213,8 @@ void blk_plug_device(struct request_queu
 		return;
 
 	if (!queue_flag_test_and_set(QUEUE_FLAG_PLUGGED, q)) {
-		mod_timer(&q->unplug_timer, jiffies + q->unplug_delay);
+		mod_timer(&q->unplug_timer,
+			round_jiffies_up(jiffies + q->unplug_delay));
 		trace_block_plug(q);
 	}
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] block core: use round_jiffies on timer to reduce wakeups
  2009-11-11  0:22 [PATCH] block core: use round_jiffies on timer to reduce wakeups Randy Dunlap
@ 2009-11-11 12:46 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2009-11-11 12:46 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml

On Tue, Nov 10 2009, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> Use round_jiffies() variant to schedule the timer along with
> other timer wakeups on the same CPU.
> 
> Source file also needs to include jiffies.h since it uses
> functions or macros from it.

round_jiffies() rounds to the next second, that's way too far away for
an event that should trigger within msecs.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-11 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-11  0:22 [PATCH] block core: use round_jiffies on timer to reduce wakeups Randy Dunlap
2009-11-11 12:46 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox