]> git.proxmox.com Git - mirror_zfs.git/commit
BRT: Change brt_pending_tree sorting order
authorAlexander Motin <mav@FreeBSD.org>
Thu, 21 Mar 2024 22:42:21 +0000 (18:42 -0400)
committerGitHub <noreply@github.com>
Thu, 21 Mar 2024 22:42:21 +0000 (15:42 -0700)
commit2c01cae8b9faca5766629aa45b2bfabaeae92e4d
tree9eccaae6eb8fe9ce865420d24bc50b79ea2f6d56
parent5c4a4f82c850be6540076ff794d25defd826dddf
BRT: Change brt_pending_tree sorting order

It does not look important how exactly brt_pending_tree is sorted.
When cloning large file, it is quite likely that all of its blocks
have identical physical birth times, so comparing them first does
not provide useful entropy, while accesses additional cache line.
In most cases combination of vdev and offset provides unique result
and physical birth time comparison is not even needed.  Meanwhile,
when traversing the tree inside brt_pending_apply(), it can be
beneficial for dbuf cache and CPU cache hits to group processing
by vdev and so by the per-VDEV BRT ZAPs.

Reviewed-by: Rob Norris <robn@despairlabs.com>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15954
module/zfs/brt.c