From: Mikulas Patocka <mpatocka@redhat.com> Date: Tue, 19 Aug 2008 16:40:16 -0400 Subject: [block] performance fix for too many physical devices Message-id: Pine.LNX.4.64.0808191414360.12962@hs20-bc2-1.build.redhat.com O-Subject: [PATCH RHEL 5.3] bz459527 performance fix for too many physical devices Bugzilla: 459527 RH-Acked-by: Milan Broz <mbroz@redhat.com> RH-Acked-by: Jeff Moyer <jmoyer@redhat.com> This patch improves performance of the block layer with too many physical devices mapped via device mapper. Testing: I compiled it on my workstation and tested it for correctness (and tested that it doesn't damage performance). I didn't test performance with that many devices, Mike Anderson did and there was overall 18% improvement (of the whole benchmark, so the improvement in the block layer is much more). Upstream commit: dbaf2c003e151ad9231778819b0977f95e20e06f (2.6.26-rc2) diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 2828104..56ffc13 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -1705,9 +1705,11 @@ EXPORT_SYMBOL(__generic_unplug_device); **/ void generic_unplug_device(request_queue_t *q) { - spin_lock_irq(q->queue_lock); - __generic_unplug_device(q); - spin_unlock_irq(q->queue_lock); + if (blk_queue_plugged(q)) { + spin_lock_irq(q->queue_lock); + __generic_unplug_device(q); + spin_unlock_irq(q->queue_lock); + } } EXPORT_SYMBOL(generic_unplug_device);