summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-stats.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2022-03-26 19:14:00 +0100
committerMike Snitzer <snitzer@kernel.org>2022-05-05 23:31:34 +0200
commit442761fd2b297d65d1cb5786249e1e07a19e9122 (patch)
tree5f2b1b8f1c25cd74c1e2c0af3ce2e6fed3941c5b /drivers/md/dm-stats.c
parentdm: introduce dm_{get,put}_live_table_bio called from dm_submit_bio (diff)
downloadlinux-442761fd2b297d65d1cb5786249e1e07a19e9122.tar.xz
linux-442761fd2b297d65d1cb5786249e1e07a19e9122.zip
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-stats.c')
-rw-r--r--drivers/md/dm-stats.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/dm-stats.c b/drivers/md/dm-stats.c
index 0e039a8c0bf2..86e0697330e8 100644
--- a/drivers/md/dm-stats.c
+++ b/drivers/md/dm-stats.c
@@ -396,6 +396,9 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
dm_stats_recalc_precise_timestamps(stats);
+ if (!static_key_enabled(&stats_enabled.key))
+ static_branch_enable(&stats_enabled);
+
mutex_unlock(&stats->mutex);
resume_callback(md);