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

!2943 ext4: mitigate cacheline false sharing in struct ext4_inode_info

Merge Pull Request from: @ci-robot 
 
PR sync from: Zeng Heng <zengheng4@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/PMYNIMACYLTDKJMQPW5MNODAS2A553TQ/ 
Mitigate cacheline false sharing in struct ext4_inode_info

Yang Yingliang (2):
  ext4: mitigatin cacheline false sharing in struct ext4_inode_info
  enable MITIGATION_FALSE_SHARING by default


--
2.25.1
 
https://gitee.com/openeuler/kernel/issues/I8J122 
 
Link:https://gitee.com/openeuler/kernel/pulls/2943

 

Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: default avatarLiu Chao <liuchao173@huawei.com>
Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 3871a15b e88110bc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6236,6 +6236,7 @@ CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_EXT4_ERROR_REPORT=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_EXT4_MITIGATION_FALSE_SHARING=y
CONFIG_JBD2=m
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=m
+1 −0
Original line number Diff line number Diff line
@@ -7313,6 +7313,7 @@ CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_EXT4_ERROR_REPORT=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_EXT4_MITIGATION_FALSE_SHARING=y
CONFIG_JBD2=m
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=m
+9 −0
Original line number Diff line number Diff line
@@ -125,3 +125,12 @@ config EXT4_ERROR_REPORT
	help
	  Implement the ext3/ext4 file system error report. Report error to
	  userspace by netlink

config EXT4_MITIGATION_FALSE_SHARING
	bool "mitigation false sharing in ext4 inode"
	depends on EXT4_FS
	default n
	help
	  Enable this to mitigation cacheline false sharing in ext4 inode info.

	  If unsure, say N.
+5 −0
Original line number Diff line number Diff line
@@ -1092,7 +1092,9 @@ struct ext4_inode_info {
	 * to occasionally drop it.
	 */
	struct rw_semaphore i_mmap_sem;
#ifndef CONFIG_EXT4_MITIGATION_FALSE_SHARING
	struct inode vfs_inode;
#endif
	struct jbd2_inode *jinode;

	spinlock_t i_raw_lock;	/* protects updates to the raw inode */
@@ -1105,6 +1107,9 @@ struct ext4_inode_info {

	/* mballoc */
	atomic_t i_prealloc_active;
#ifdef CONFIG_EXT4_MITIGATION_FALSE_SHARING
	struct inode vfs_inode;
#endif
	struct list_head i_prealloc_list;
	spinlock_t i_prealloc_lock;

+4 −0
Original line number Diff line number Diff line
@@ -1436,7 +1436,11 @@ static void init_once(void *foo)
static int __init init_inodecache(void)
{
	ext4_inode_cachep = kmem_cache_create_usercopy("ext4_inode_cache",
#ifdef CONFIG_EXT4_MITIGATION_FALSE_SHARING
				sizeof(struct ext4_inode_info), 128,
#else
				sizeof(struct ext4_inode_info), 0,
#endif
				(SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|
					SLAB_ACCOUNT),
				offsetof(struct ext4_inode_info, i_data),