All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm: reduce the number of processes per dm device
@ 2015-10-08 16:15 Mikulas Patocka
  2015-10-08 19:08 ` Mike Snitzer
  2015-10-21 20:34 ` [PATCH v2] " Mikulas Patocka
  0 siblings, 2 replies; 6+ messages in thread
From: Mikulas Patocka @ 2015-10-08 16:15 UTC (permalink / raw)
  To: Alasdair G. Kergon, Zdenek Kabelac, Mike Snitzer; +Cc: dm-devel

The patch 54efd50bfd873e2dbf784e0b21a8027ba4299a3e ("block: make
generic_make_request handle arbitrarily sized bios") makes it possible for
block devices to process large bios. The patch allocates a new bio set
queue->bio_split for each device, this bio set is used for allocating bios
when the driver needs to split large bios.

Each bio_set allocates a workqueue process, thus the above patch increases
the number of processes allocated per block device.

Device mapper doesn't need the queue->bio_split bio_set, thus we can
deallocate it. This reduces the number of allocated processes per
dm-device from 3 to 2.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 drivers/md/dm.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-4.3-rc4/drivers/md/dm.c
===================================================================
--- linux-4.3-rc4.orig/drivers/md/dm.c	2015-10-08 16:23:09.000000000 +0200
+++ linux-4.3-rc4/drivers/md/dm.c	2015-10-08 16:30:40.000000000 +0200
@@ -2839,6 +2839,12 @@ int dm_setup_md_queue(struct mapped_devi
 	case DM_TYPE_BIO_BASED:
 		dm_init_old_md_queue(md);
 		blk_queue_make_request(md->queue, dm_make_request);
+		/*
+		 * We don't need the bioset, so we free it to save one process
+		 * per device.
+		 */
+		bioset_free(md->queue->bio_split);
+		md->queue->bio_split = NULL;
 		break;
 	}
 

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

end of thread, other threads:[~2015-10-21 20:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08 16:15 [PATCH] dm: reduce the number of processes per dm device Mikulas Patocka
2015-10-08 19:08 ` Mike Snitzer
2015-10-08 19:59   ` Mikulas Patocka
2015-10-08 20:15     ` Mike Snitzer
2015-10-08 20:29       ` Mikulas Patocka
2015-10-21 20:34 ` [PATCH v2] " Mikulas Patocka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.