]> git.baikalelectronics.ru Git - kernel.git/commit
mbcache2: Use referenced bit instead of LRU
authorJan Kara <jack@suse.cz>
Mon, 22 Feb 2016 23:23:47 +0000 (18:23 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 22 Feb 2016 23:23:47 +0000 (18:23 -0500)
commitd6d161f45342b139786ad9cab1a75d4c7d5412c7
tree67a5822eb2c25bf5c89e6e52a81e6fc8cde7d7ba
parent6c91d9faaa5421541390d14204e8e0896b861e9b
mbcache2: Use referenced bit instead of LRU

Currently we maintain perfect LRU list by moving entry to the tail of
the list when it gets used. However these operations on cache-global
list are relatively expensive.

In this patch we switch to lazy updates of LRU list. Whenever entry gets
used, we set a referenced bit in it. When reclaiming entries, we give
referenced entries another round in the LRU. Since the list is not a
real LRU anymore, rename it to just 'list'.

In my testing this logic gives about 30% boost to workloads with mostly
unique xattr blocks (e.g. xattr-bench with 10 files and 10000 unique
xattr values).

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/mbcache2.c
include/linux/mbcache2.h