]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: reduce size of struct btrfs_free_space_ctl
authorFilipe Manana <fdmanana@suse.com>
Wed, 15 Apr 2026 14:06:13 +0000 (15:06 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Jun 2026 13:53:29 +0000 (15:53 +0200)
We have a 4 bytes hole in the structure, reorder some fields so that we
eliminate the hole and reduce the structure size from 144 bytes down to
136 bytes. This way on a 4K page system, we can fit 30 structures per
page instead of 28.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-cache.h

index 2ee0b876723a5237d32d5f157217137db5015d80..c5d0f3e056cc0a0b7ac6c6b8b4bb93e1bd6b3518 100644 (file)
@@ -74,13 +74,13 @@ enum {
 };
 
 struct btrfs_free_space_ctl {
-       spinlock_t tree_lock;
        struct rb_root free_space_offset;
        struct rb_root_cached free_space_bytes;
-       u64 free_space;
+       spinlock_t tree_lock;
        int extents_thresh;
        int free_extents;
        int total_bitmaps;
+       u64 free_space;
        s32 discardable_extents[BTRFS_STAT_NR_ENTRIES];
        s64 discardable_bytes[BTRFS_STAT_NR_ENTRIES];
        const struct btrfs_free_space_op *op;