summaryrefslogtreecommitdiff
path: root/fs/hfs
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2023-12-04 19:20:30 +0300
committerDavid Sterba <dsterba@suse.com>2023-12-16 00:59:01 +0300
commit1a9fb16c60526253ecf9913b6ea48cfcdcb4c023 (patch)
treea84ecca810ca83c5254cf903c5074effcba8af1f /fs/hfs
parent00deaf04df35536d192544ea57b6da9a88519422 (diff)
downloadlinux-1a9fb16c60526253ecf9913b6ea48cfcdcb4c023.tar.xz
btrfs: avoid useless rbtree iterations when attempting to merge extent map
When trying to merge an extent map that was just inserted or unpinned, we will try to merge it with any adjacent extent map that is suitable. However we will only check if our extent map is mergeable after searching for the previous and next extent maps in the rbtree, meaning that we are doing unnecessary calls to rb_prev() and rb_next() in case our extent map is not mergeable (it's compressed, in the list of modifed extents, being logged or pinned), wasting CPU time chasing rbtree pointers and pulling in unnecessary cache lines. So change the logic to check first if an extent map is mergeable before searching for the next and previous extent maps in the rbtree. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/hfs')
0 files changed, 0 insertions, 0 deletions