Unverified Commit f0732647 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5284 [OLK-6.6] fs/address_space: move i_mmap_rwsem to mitigate a false sharing with i_mmap.

Merge Pull Request from: @leoliu-oc 
 
In the struct address_space, there is a 32-byte gap between i_mmap
and i_mmap_rwsem. Due to the alignment of struct address_space
variables to 8 bytes, in certain situations, i_mmap and i_mmap_rwsem
may end up in the same CACHE line.

While running Unixbench/execl, we observe high false sharing issues
when accessing i_mmap against i_mmap_rwsem. We move i_mmap_rwsem
after i_private_list, ensuring a 64-byte gap between i_mmap and
i_mmap_rwsem.

For Intel Silver machines (2 sockets) using kernel v6.8 rc-2, the score
of Unixbench/execl improves by ~3.94%, and the score of Unixbench/shell
improves by ~3.26%.

https://gitee.com/openeuler/kernel/issues/I99AZK 
 
Link:https://gitee.com/openeuler/kernel/pulls/5284

 

Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 3b469ecc 45f3e952
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -500,10 +500,10 @@ struct address_space {
	pgoff_t			writeback_index;
	const struct address_space_operations *a_ops;
	unsigned long		flags;
	struct rw_semaphore	i_mmap_rwsem;
	errseq_t		wb_err;
	spinlock_t		private_lock;
	struct list_head	private_list;
	struct rw_semaphore	i_mmap_rwsem;
	void			*private_data;

	KABI_RESERVE(1)