OSDN Git Service

dm bio prison v1: improve concurrent IO performance
authorJoe Thornber <ejt@redhat.com>
Thu, 2 Mar 2023 09:35:37 +0000 (09:35 +0000)
committerMike Snitzer <snitzer@kernel.org>
Thu, 30 Mar 2023 19:57:51 +0000 (15:57 -0400)
commite2dd8aca2d76f937f1f08d03041684f3532e9df4
tree85b1a068359746c3bd77338dd039c7afe84c197a
parent06961c487a33a222fd3d84998dc6398ed0449373
dm bio prison v1: improve concurrent IO performance

Split the bio prison into multiple regions, with a separate rbtree and
associated lock for each region.

To get fast bio prison locking and not damage the performance of
discards too much the bio-prison now stipulates that discards should
not cross a BIO_PRISON_MAX_RANGE boundary.

Because the range of a key (block_end - block_begin) must not exceed
BIO_PRISON_MAX_RANGE: break_up_discard_bio() now ensures the data
range reflected in PHYSICAL key doesn't exceed BIO_PRISON_MAX_RANGE.
And splitting the thin target's discards (handled with VIRTUAL key) is
achieved by updating dm-thin.c to set limits->max_discard_sectors in
terms of BIO_PRISON_MAX_RANGE _and_ setting the thin and thin-pool
targets' max_discard_granularity to true.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-bio-prison-v1.c
drivers/md/dm-bio-prison-v1.h
drivers/md/dm-thin.c