]> www.infradead.org Git - users/hch/configfs.git/commit
configfs: improve item creation performance for-next configfs-6.13-2024-11-19
authorSeamus Connor <sconnor@purestorage.com>
Thu, 14 Nov 2024 05:29:22 +0000 (06:29 +0100)
committerChristoph Hellwig <hch@lst.de>
Thu, 14 Nov 2024 06:45:20 +0000 (07:45 +0100)
commit84147f4e84c4f4822006161c5ad43612ac906407
tree207a84fbda8ec9446ebbedf748bd7edec85a8e68
parent8312c879e10cd2c29739f875a9f743db13a583b5
configfs: improve item creation performance

As the size of a directory increases item creation slows down.
Optimizing access to s_children removes this bottleneck.

dirents are already pinned into the cache, there is no need to scan the
s_children list looking for duplicate Items. The configfs_dirent_exists
check is moved to a location where it is called only during subsystem
initialization.

d_lookup will only need to call configfs_lookup in the case where the
item in question is not pinned to dcache. The only items not pinned to
dcache are attributes. These are placed at the front of the s_children
list, whilst pinned items are inserted at the back. configfs_lookup
stops scanning when it encounters the first pinned entry in s_children.

The assumption of the above optimizations is that there will be few
attributes, but potentially many Items in a given directory.

Signed-off-by: Seamus Connor <sconnor@purestorage.com>
Reviewed-by: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/configfs/configfs_internal.h
fs/configfs/dir.c