Skip to contentSkip to conversation

dm: use percpu counters

PATCH In review Mikulas Patocka 1 participant 1 message Nov 16, 2018

Subsystems (2)
lore
Share & tools
lore

Mikulas Patocka

author maintainer
#0 lore raw

PATCH 2/3 dm: use percpu counters

Use percpu inflight counters to avoid cache line bouncing and improve performance.

---
 drivers/md/dm-core.h |    5 +++++
 drivers/md/dm.c      |   50 ++++++++++++++++++++++++++++++++++----------------
 2 files changed, 39 insertions(+), 16 deletions(-)
drivers/md/dm-core.h +5 -0
Index: linux-dm/drivers/md/dm-core.h
===================================================================
@@ -24,6 +24,10 @@ struct dm_kobject_holder {
 	struct completion completion;
 };
 
+struct dm_percpu {
+	unsigned inflight[2];
+};
+
 /*
  * DM core internal structure that used directly by dm.c and dm-rq.c
  * DM targets must _not_ deference a mapped_device to directly access its members!
@@ -63,6 +67,7 @@ struct mapped_device {
 	/*
 	 * A list of ios that arrived while we were suspended.
 	 */
+	struct dm_percpu __percpu *counters;
 	struct work_struct work;
 	wait_queue_head_t wait;
 	spinlock_t deferred_lock;
drivers/md/dm.c +34 -16

90 lines not on this page · raw message