diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2016-02-22 22:44:04 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-02-22 22:44:04 -0500 |
commit | 6048c64b26097a0ffbd966866b599f990e674e9b (patch) | |
tree | 412b3e62328842563ef70e6ab68a1dd539038a90 /firmware | |
parent | 3fd164629d25b04f291a79a013dcc7ce1a301269 (diff) |
mbcache: add reusable flag to cache entries
To reduce amount of damage caused by single bad block, we limit number
of inodes sharing an xattr block to 1024. Thus there can be more xattr
blocks with the same contents when there are lots of files with the same
extended attributes. These xattr blocks naturally result in hash
collisions and can form long hash chains and we unnecessarily check each
such block only to find out we cannot use it because it is already
shared by too many inodes.
Add a reusable flag to cache entries which is cleared when a cache entry
has reached its maximum refcount. Cache entries which are not marked
reusable are skipped by mb_cache_entry_find_{first,next}. This
significantly speeds up mbcache when there are many same xattr blocks.
For example for xattr-bench with 5 values and each process handling
20000 files, the run for 64 processes is 25x faster with this patch.
Even for 8 processes the speedup is almost 3x. We have also verified
that for situations where there is only one xattr block of each kind,
the patch doesn't have a measurable cost.
[JK: Remove handling of setting the same value since it is not needed
anymore, check for races in e_reusable setting, improve changelog,
add measurements]
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions