From e5f5b7a64e6b8376622979fc63f2bb00b2cf8944 Mon Sep 17 00:00:00 2001 From: RoyHuang Date: Sat, 12 Apr 2025 18:03:02 +0800 Subject: [PATCH] Refine simplefs_sb_info to align with cacheline The ifree_bitmap and ibfree_bitmap fields are frequently used together. To enhance performance, we reorganized the structure layout to align with 64-byte cache lines. --- simplefs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/simplefs.h b/simplefs.h index dc612bc..e365a82 100644 --- a/simplefs.h +++ b/simplefs.h @@ -142,6 +142,8 @@ struct simplefs_sb_info { uint32_t nr_free_inodes; /* Number of free inodes */ uint32_t nr_free_blocks; /* Number of free blocks */ + unsigned long *ifree_bitmap; /* In-memory free inodes bitmap */ + unsigned long *bfree_bitmap; /* In-memory free blocks bitmap */ #ifdef __KERNEL__ journal_t *journal; struct block_device *s_journal_bdev; /* v5.10+ external journal device */ @@ -150,10 +152,8 @@ struct simplefs_sb_info { #elif SIMPLEFS_AT_LEAST(6, 7, 0) struct bdev_handle *s_journal_bdev_handle; /* v6.7+ external journal device */ -#endif - unsigned long *ifree_bitmap; /* In-memory free inodes bitmap */ - unsigned long *bfree_bitmap; /* In-memory free blocks bitmap */ -#endif +#endif /* SIMPLEFS_AT_LEAST */ +#endif /* __KERNEL__ */ }; #endif /* SIMPLEFS_H */