Improve sorted scan memory accounting
commit87b46d63b283d9e2c3b10945f37233d1dedef02a
authorAlexander Motin <mav@FreeBSD.org>
Fri, 10 Jun 2022 17:01:46 +0000 (10 13:01 -0400)
committerGitHub <noreply@github.com>
Fri, 10 Jun 2022 17:01:46 +0000 (10 10:01 -0700)
tree4d578a5ad5f713eb0226acdfcaf7113ddc24b04a
parent4ed5e25074ffec266df38556d9b3a928c5e0dee9
Improve sorted scan memory accounting

Since we use two B-trees q_exts_by_size and q_exts_by_addr, we should
count 2x sizeof (range_seg_gap_t) per node.  And since average B-tree
memory efficiency is about 75%, we should increase it to 3x.

Previous code under-counted up to 30% of the memory usage.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #13537
module/zfs/dsl_scan.c