summaryrefslogtreecommitdiff
path: root/drivers/md/dm-core.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2022-03-26 14:14:00 -0400
committerMike Snitzer <snitzer@kernel.org>2022-05-05 17:31:34 -0400
commit442761fd2b297d65d1cb5786249e1e07a19e9122 (patch)
tree5f2b1b8f1c25cd74c1e2c0af3ce2e6fed3941c5b /drivers/md/dm-core.h
parent563a225c9fd207326c2a2af9d59b4097cb31ce70 (diff)
dm: conditionally enable branching for less used features
Use jump_labels to further reduce cost of unlikely branches for zoned block devices, dm-stats and swap_bios throttling. Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-core.h')
-rw-r--r--drivers/md/dm-core.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-core.h b/drivers/md/dm-core.h
index 41d6511dc7cf..8ba99eaa0872 100644
--- a/drivers/md/dm-core.h
+++ b/drivers/md/dm-core.h
@@ -13,6 +13,7 @@
#include <linux/ktime.h>
#include <linux/blk-mq.h>
#include <linux/blk-crypto-profile.h>
+#include <linux/jump_label.h>
#include <trace/events/block.h>
@@ -154,6 +155,10 @@ static inline struct dm_stats *dm_get_stats(struct mapped_device *md)
return &md->stats;
}
+DECLARE_STATIC_KEY_FALSE(stats_enabled);
+DECLARE_STATIC_KEY_FALSE(swap_bios_enabled);
+DECLARE_STATIC_KEY_FALSE(zoned_enabled);
+
static inline bool dm_emulate_zone_append(struct mapped_device *md)
{
if (blk_queue_is_zoned(md->queue))