summaryrefslogtreecommitdiffstats
path: root/drivers/md/persistent-data/dm-btree-remove.c
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2021-04-13 12:03:45 +0200
committerMike Snitzer <snitzer@redhat.com>2021-06-04 18:07:22 +0200
commitbe500ed721a6ec8d49bf0814c277ce7162acee0e (patch)
treeb61c5518a38b187dd2ffd4a830ca64105e41fe2c /drivers/md/persistent-data/dm-btree-remove.c
parentdm space maps: don't reset space map allocation cursor when committing (diff)
downloadlinux-be500ed721a6ec8d49bf0814c277ce7162acee0e.tar.xz
linux-be500ed721a6ec8d49bf0814c277ce7162acee0e.zip
dm space maps: improve performance with inc/dec on ranges of blocks
When we break sharing on btree nodes we typically need to increment the reference counts to every value held in the node. This can cause a lot of repeated calls to the space maps. Fix this by changing the interface to the space map inc/dec methods to take ranges of adjacent blocks to be operated on. For installations that are using a lot of snapshots this will reduce cpu overhead of fundamental operations such as provisioning a new block, or deleting a snapshot, by as much as 10 times. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/persistent-data/dm-btree-remove.c')
-rw-r--r--drivers/md/persistent-data/dm-btree-remove.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c
index eff04fa23dfa..b34af195bf2a 100644
--- a/drivers/md/persistent-data/dm-btree-remove.c
+++ b/drivers/md/persistent-data/dm-btree-remove.c
@@ -544,7 +544,7 @@ int dm_btree_remove(struct dm_btree_info *info, dm_block_t root,
if (info->value_type.dec)
info->value_type.dec(info->value_type.context,
- value_ptr(n, index));
+ value_ptr(n, index), 1);
delete_at(n, index);
}
@@ -653,7 +653,7 @@ static int remove_one(struct dm_btree_info *info, dm_block_t root,
if (k >= keys[last_level] && k < end_key) {
if (info->value_type.dec)
info->value_type.dec(info->value_type.context,
- value_ptr(n, index));
+ value_ptr(n, index), 1);
delete_at(n, index);
keys[last_level] = k + 1ull;