fs/proc: split the inode list for procfs - #2638
Closed
vfsci-bot[bot] wants to merge 3 commits into
Closed
vfsci-bot[bot] wants to merge 3 commits into
vfsci-bot[bot] wants to merge 3 commits into
Conversation
added 3 commits
September 20, 2026 11:03
Add a new flag SB_I_NO_PAGECACHE for superblock. Skip scanning the inode lists of filesystems that have no page cache in drop_pagecache_sb(), as indicated by the SB_I_NO_PAGECACHE flag. This patch only changes the procfs. Signed-off-by: Huang Shijie <huangsj@hygon.cn>
Introduce a helper sb_inodes_empty() which is used to detect if the inodes list is empty. Signed-off-by: Huang Shijie <huangsj@hygon.cn>
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 perf shows it consuming ~90% of the lock hotspot.
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 spreads the inode list across per-shard locks for procfs:
--- Add three fields in super_block:
shards : the pointer for the array of inode_shard.
nr_shards: the size of the array
s_inode_list_sharded: whether or not to use a sharded inode list
struct inode_shard is cacheline-aligned to avoid false
sharing between shard locks on different NUMA nodes.
--- Add inode_list_add()/inode_list_del() callbacks to super_operations;
procfs implements them to round-robin inodes
onto nr_shards = DIV_ROUND_UP(num_possible_cpus(), 32)
shards allocated at mount time, each protected by its own spinlock.
--- For procfs, the "unmount" will call evict_inodes(),
generic_shutdown_super() and hook_sb_delete() which will
iterate the shards when the super_block inode list is sharded.
Change these functions to work with the sharded inode list.
This reduces the s_inode_list_lock hotspot from ~90% to ~1% in TestDFSIO.
And we can improve the hadoop performance over 50%.
Signed-off-by: Huang Shijie <huangsj@hygon.cn>
Author
|
This PR is older than 14 days. Closing automatically. If the series is still relevant, a new version will create a new PR. Automated by ml2pr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Series: https://patchwork.kernel.org/project/linux-fsdevel/list/?series=1169648
Submitter: Huang Shijie
Version: 2
Patches: 3/3
Message-ID:
<20260920072811.2064247-1-huangsj@hygon.cn>Base: vfs.base.ci
Lore: https://lore.kernel.org/linux-fsdevel/20260920072811.2064247-1-huangsj@hygon.cn
Automated by ml2pr