From: Randy Dunlap <randy.dunlap@oracle.com>
To: lkml <linux-kernel@vger.kernel.org>, Jens Axboe <jens.axboe@oracle.com>
Subject: [PATCH] block core: use round_jiffies on timer to reduce wakeups
Date: Tue, 10 Nov 2009 16:22:19 -0800 [thread overview]
Message-ID: <4AFA03BB.90405@oracle.com> (raw)
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);
}
}
next reply other threads:[~2009-11-11 0:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-11 0:22 Randy Dunlap [this message]
2009-11-11 12:46 ` [PATCH] block core: use round_jiffies on timer to reduce wakeups Jens Axboe
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=4AFA03BB.90405@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox