[PATCH 0/2] Bitmap percentage flushing

From: Jonathan Derrick
Date: Thu Oct 06 2022 - 18:09:20 EST

This introduces a percentage-flushing mechanism that works in-tandem to
the delay timer. The percentage argument is based on the number of
chunks dirty. It was chosen to use number of chunks due to large drives requiring
smaller and smaller percentages (eg, 32TB drives-> 1% is 320GB).

The first patch fixes a performance gap observed in RAID1
configurations. With a synchronous qd1 workload, bitmap writes can
easily become almost half of the I/O. This could be argued to be
expected, but undesirable. Moving the unplug operation to the periodic
delay work seemed to help the situation.

The second part of this set adds a new field in the superblock and
version, allowing for a new argument through mdadm specifying the number
of chunks allowed to be dirty before flushing.

Accompanying this set is an RFC for mdadm patch. It lacks documentation
which will be sent in v2 if this changeset is appropriate.

Jonathan Derrick (2):
md/bitmap: Move unplug to daemon thread
md/bitmap: Add chunk-count-based bitmap flushing

drivers/md/md-bitmap.c | 38 +++++++++++++++++++++++++++++++++++---
drivers/md/md-bitmap.h | 5 ++++-
drivers/md/md.h | 1 +
drivers/md/raid1.c | 2 --
drivers/md/raid10.c | 4 ----
5 files changed, 40 insertions(+), 10 deletions(-)