[RFC PATCH v2 0/3] fs/proc: split the inode list for procfs

Huang Shijie posted 3 patches 4 days, 12 hours ago
fs/drop_caches.c               |   3 +
fs/inode.c                     |  79 ++++++++++------
fs/proc/inode.c                |  53 +++++++++++
fs/proc/internal.h             |   2 +
fs/proc/root.c                 |   8 +-
fs/super.c                     |  45 +++++++--
include/linux/fs/super_types.h |  17 ++++
include/linux/proc_fs.h        |   1 +
security/landlock/fs.c         | 162 ++++++++++++++++++---------------
9 files changed, 260 insertions(+), 110 deletions(-)
[RFC PATCH v2 0/3] fs/proc: split the inode list for procfs
Posted by Huang Shijie 4 days, 12 hours ago
The global s_inode_list_lock is heavily contended in procfs
on a 384-CPU, 12-NUMA-node Hygon machine running Hadoop TestDFSIO:
  #hadoop jar xxxx.jar TestDFSIO -read -nrFiles 1000 -size 100MB

The hadoop will create lot of threads during the test.
The perf shows it consuming ~90% of the lock hotspot in procfs.
The lock is hit from both directions:
   -- inode creation (~49%) :
           getdents64 ->
              proc_readfd_common ->
	         new_inode ->
		   inode_sb_list_add()

   -- inode eviction (~41%):
           process exit ->
	      release_task ->
	         proc_invalidate_siblings_dcache ->
		     evict ->
		        inode_sb_list_del()

This patch set tries to resolve this issue by:
    patch 1: "fs/drop_caches: skip filesystems without page cache"
 	add a new flag for filesystems without page cache.
    patch 2: Add a new helper to detect the empty inode list    
    patch 3: split the inode list.


After this patch set, the above TestDFSIO can get over 50% better performance
in exec time. And the procfs lock hotspot becomes nearly 1%.

Huang Shijie (3):
  fs/drop_caches: skip filesystems without page cache
  fs/super: introduce a helper sb_inodes_empty()
  fs/proc: split the inode list

 fs/drop_caches.c               |   3 +
 fs/inode.c                     |  79 ++++++++++------
 fs/proc/inode.c                |  53 +++++++++++
 fs/proc/internal.h             |   2 +
 fs/proc/root.c                 |   8 +-
 fs/super.c                     |  45 +++++++--
 include/linux/fs/super_types.h |  17 ++++
 include/linux/proc_fs.h        |   1 +
 security/landlock/fs.c         | 162 ++++++++++++++++++---------------
 9 files changed, 260 insertions(+), 110 deletions(-)

-- 
2.53.0