public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] use cheaper elv_queue_empty when unplug a device
@ 2005-03-29  2:53 Chen, Kenneth W
  2005-03-29  8:06 ` Jens Axboe
  0 siblings, 1 reply; 19+ messages in thread
From: Chen, Kenneth W @ 2005-03-29  2:53 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel

This patch was posted last year and if I remember correctly, Jens said
he is OK with the patch.  In function __generic_unplug_deivce(), 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: Ken Chen <kenneth.w.chen@intel.com>


--- linux-2.6.11/drivers/block/ll_rw_blk.c.orig	2005-03-28 18:22:26.000000000 -0800
+++ linux-2.6.11/drivers/block/ll_rw_blk.c	2005-03-28 18:44:46.000000000 -0800
@@ -1459,7 +1459,7 @@ void __generic_unplug_device(request_que
 	/*
 	 * was plugged, fire request_fn if queue has stuff to do
 	 */
-	if (elv_next_request(q))
+	if (!elv_queue_empty(q))
 		q->request_fn(q);
 }
 EXPORT_SYMBOL(__generic_unplug_device);
@@ -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);





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

end of thread, other threads:[~2005-04-08 10:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-29  2:53 [patch] use cheaper elv_queue_empty when unplug a device Chen, Kenneth W
2005-03-29  8:06 ` Jens Axboe
2005-03-29  9:19   ` Nick Piggin
2005-03-29  9:21     ` Nick Piggin
2005-03-29  9:28     ` Jens Axboe
2005-03-29  9:50       ` Nick Piggin
2005-03-29 10:06       ` Nick Piggin
2005-03-30  0:57         ` Nick Piggin
2005-03-30  8:11           ` Jens Axboe
2005-04-08  9:45           ` Jens Axboe
2005-04-08  9:55             ` Nick Piggin
2005-04-08 10:02               ` Jens Axboe
2005-04-08 10:22                 ` Nick Piggin
2005-03-29 10:10     ` Arjan van de Ven
2005-03-29 10:19       ` Jens Axboe
2005-03-29 10:23       ` Nick Piggin
2005-03-29 13:15     ` Jens Axboe
2005-03-30  0:07       ` Nick Piggin
2005-03-29 19:02     ` Chen, Kenneth W

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