From 36fcc4665dcb19920ca59158338de1bcd6fa94f4 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 5 May 2021 14:43:46 -0700 Subject: [PATCH] Align first free ino to lock group Currently the first inode number that can be allocated directly follows the root inode. This means the first batch of allocated inodes are in the same lock group as the root inode. The root inode is a bit special. It is always hot as absolute path lookups and inode-to-path resolution always read directory entries from the root. Let's try aligning the first free inode number to the next inode lock group boundary. This will stop work in those inodes from necessarily conflicting with work in the root inode. Signed-off-by: Zach Brown --- utils/src/mkfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/src/mkfs.c b/utils/src/mkfs.c index 00a302eb..6d2213e6 100644 --- a/utils/src/mkfs.c +++ b/utils/src/mkfs.c @@ -238,7 +238,7 @@ static int do_mkfs(struct mkfs_args *args) memset(super, 0, SCOUTFS_BLOCK_SM_SIZE); super->version = cpu_to_le64(SCOUTFS_INTEROP_VERSION); uuid_generate(super->uuid); - super->next_ino = cpu_to_le64(SCOUTFS_ROOT_INO + 1); + super->next_ino = cpu_to_le64(round_up(SCOUTFS_ROOT_INO + 1, SCOUTFS_LOCK_INODE_GROUP_NR)); super->seq = cpu_to_le64(1); super->total_meta_blocks = cpu_to_le64(last_meta + 1); super->total_data_blocks = cpu_to_le64(last_data + 1);