From de70ca23721ecb3a23d77cedee058bc33080594f Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 28 Nov 2025 10:51:10 -0800 Subject: [PATCH] Increase server commit block budget for alloc move A few callers of alloc_move_empty in the server were providing a budget that was too small. Recent changes to extent_mod_blocks increased the max budget that is necessary to move extents between btrees. The existing WAG of 100 was too small for trees of height 2 and 3. This caused looping in production. We can increase the move budget to half the overall commit budget, which leaves room for a height of around 7 each. This is much greater than we see in practice because the size of the per-mount btrees is effectiely limited by both watermarks and thresholds to commit and drain. Signed-off-by: Zach Brown --- kmod/src/server.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kmod/src/server.c b/kmod/src/server.c index 43a63784..ac604e74 100644 --- a/kmod/src/server.c +++ b/kmod/src/server.c @@ -1618,7 +1618,8 @@ static int server_get_log_trees(struct super_block *sb, goto update; } - ret = alloc_move_empty(sb, &super->data_alloc, <.data_freed, 100); + ret = alloc_move_empty(sb, &super->data_alloc, <.data_freed, + COMMIT_HOLD_ALLOC_BUDGET / 2); if (ret == -EINPROGRESS) ret = 0; if (ret < 0) { @@ -1913,9 +1914,11 @@ static int reclaim_open_log_tree(struct super_block *sb, u64 rid) scoutfs_alloc_splice_list(sb, &server->alloc, &server->wri, server->other_freed, <.meta_avail)) ?: (err_str = "empty data_avail", - alloc_move_empty(sb, &super->data_alloc, <.data_avail, 100)) ?: + alloc_move_empty(sb, &super->data_alloc, <.data_avail, + COMMIT_HOLD_ALLOC_BUDGET / 2)) ?: (err_str = "empty data_freed", - alloc_move_empty(sb, &super->data_alloc, <.data_freed, 100)); + alloc_move_empty(sb, &super->data_alloc, <.data_freed, + COMMIT_HOLD_ALLOC_BUDGET / 2)); mutex_unlock(&server->alloc_mutex); /* only finalize, allowing merging, once the allocators are fully freed */