mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
ovl: use plain list filler in indexdir and workdir cleanup
Those two cleanup routines are using the helper ovl_dir_read() with the
merge dir filler, which populates an rb tree, that is never used.
The index dir entry names all have a long (42 bytes) constant prefix, so it
is not surprising that perf top has demostrated high CPU usage by rb tree
population during cleanup of a large index dir:
- 9.53% ovl_fill_merge
- 78.41% ovl_cache_entry_find_link.constprop.27
+ 72.11% strncmp
Use the plain list filler that does not populate the unneeded rb tree.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
8ea2876577
commit
af4dcb6d78
|
|
@ -1071,14 +1071,10 @@ static int ovl_workdir_cleanup_recurse(struct ovl_fs *ofs, const struct path *pa
|
|||
int err;
|
||||
struct inode *dir = path->dentry->d_inode;
|
||||
LIST_HEAD(list);
|
||||
struct rb_root root = RB_ROOT;
|
||||
struct ovl_cache_entry *p;
|
||||
struct ovl_readdir_data rdd = {
|
||||
.ctx.actor = ovl_fill_merge,
|
||||
.dentry = NULL,
|
||||
.ctx.actor = ovl_fill_plain,
|
||||
.list = &list,
|
||||
.root = &root,
|
||||
.is_lowest = false,
|
||||
};
|
||||
bool incompat = false;
|
||||
|
||||
|
|
@ -1159,14 +1155,10 @@ int ovl_indexdir_cleanup(struct ovl_fs *ofs)
|
|||
struct inode *dir = indexdir->d_inode;
|
||||
struct path path = { .mnt = ovl_upper_mnt(ofs), .dentry = indexdir };
|
||||
LIST_HEAD(list);
|
||||
struct rb_root root = RB_ROOT;
|
||||
struct ovl_cache_entry *p;
|
||||
struct ovl_readdir_data rdd = {
|
||||
.ctx.actor = ovl_fill_merge,
|
||||
.dentry = NULL,
|
||||
.ctx.actor = ovl_fill_plain,
|
||||
.list = &list,
|
||||
.root = &root,
|
||||
.is_lowest = false,
|
||||
};
|
||||
|
||||
err = ovl_dir_read(&path, &rdd);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user