summaryrefslogtreecommitdiff
path: root/drivers/md/md-bitmap.h
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2023-05-29 16:11:03 +0300
committerSong Liu <song@kernel.org>2023-06-14 01:25:44 +0300
commit7db922bae3abdf0a1db81ef7228cc0b996a0c1e3 (patch)
treec033c61f7fa1d3fb874ce1c8282852da0631913d /drivers/md/md-bitmap.h
parent8295efbe68c080047e98d9c0eb5cb933b238a8cb (diff)
downloadlinux-7db922bae3abdf0a1db81ef7228cc0b996a0c1e3.tar.xz
md/raid1-10: submit write io directly if bitmap is not enabled
Commit 6cce3b23f6f8 ("[PATCH] md: write intent bitmap support for raid10") add bitmap support, and it changed that write io is submitted through daemon thread because bitmap need to be updated before write io. And later, plug is used to fix performance regression because all the write io will go to demon thread, which means io can't be issued concurrently. However, if bitmap is not enabled, the write io should not go to daemon thread in the first place, and plug is not needed as well. Fixes: 6cce3b23f6f8 ("[PATCH] md: write intent bitmap support for raid10") Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20230529131106.2123367-5-yukuai1@huaweicloud.com
Diffstat (limited to 'drivers/md/md-bitmap.h')
-rw-r--r--drivers/md/md-bitmap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/md-bitmap.h b/drivers/md/md-bitmap.h
index cfd7395de8fd..3a4750952b3a 100644
--- a/drivers/md/md-bitmap.h
+++ b/drivers/md/md-bitmap.h
@@ -273,6 +273,13 @@ int md_bitmap_copy_from_slot(struct mddev *mddev, int slot,
sector_t *lo, sector_t *hi, bool clear_bits);
void md_bitmap_free(struct bitmap *bitmap);
void md_bitmap_wait_behind_writes(struct mddev *mddev);
+
+static inline bool md_bitmap_enabled(struct bitmap *bitmap)
+{
+ return bitmap && bitmap->storage.filemap &&
+ !test_bit(BITMAP_STALE, &bitmap->flags);
+}
+
#endif
#endif