From: akpm@osdl.org
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org,
kenneth.w.chen@intel.com, axboe@suse.de
Subject: [patch 128/198] use cheaper elv_queue_empty when unplug a device
Date: Tue, 12 Apr 2005 03:32:34 -0700 [thread overview]
Message-ID: <200504121032.j3CAWe8M005649@shell0.pdx.osdl.net> (raw)
From: Ken Chen <kenneth.w.chen@intel.com>
In function __generic_unplug_device(), kernel can use a cheaper function
elv_queue_empty() instead of more expensive elv_next_request to find
whether the queue is empty or not. blk_run_queue can also made conditional
on whether queue's emptiness before calling request_fn().
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
25-akpm/drivers/block/ll_rw_blk.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
diff -puN drivers/block/ll_rw_blk.c~use-cheaper-elv_queue_empty-when-unplug-a-device drivers/block/ll_rw_blk.c
--- 25/drivers/block/ll_rw_blk.c~use-cheaper-elv_queue_empty-when-unplug-a-device 2005-04-12 03:21:34.394908080 -0700
+++ 25-akpm/drivers/block/ll_rw_blk.c 2005-04-12 03:21:34.399907320 -0700
@@ -1589,7 +1589,8 @@ void blk_run_queue(struct request_queue
spin_lock_irqsave(q->queue_lock, flags);
blk_remove_plug(q);
- q->request_fn(q);
+ if (!elv_queue_empty(q))
+ q->request_fn(q);
spin_unlock_irqrestore(q->queue_lock, flags);
}
EXPORT_SYMBOL(blk_run_queue);
_
reply other threads:[~2005-04-12 18:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200504121032.j3CAWe8M005649@shell0.pdx.osdl.net \
--to=akpm@osdl.org \
--cc=axboe@suse.de \
--cc=kenneth.w.chen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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
all inboxes | Powered by JetHome®