diff options
author | Chao Yu <chao2.yu@samsung.com> | 2016-02-19 13:12:28 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-02-23 08:39:55 +0300 |
commit | 1515aef0130845c6a5c72a3710df362f79eb9fb1 (patch) | |
tree | 5c5959c4643df4505b1fd53069a06360feba533c /fs/f2fs/super.c | |
parent | b7ad7512b84b26f1c0ec823647a387627c138d32 (diff) | |
download | linux-1515aef0130845c6a5c72a3710df362f79eb9fb1.tar.xz |
f2fs: reorder nat cache lock in cache_nat_entry
When lookuping nat entry in cache_nat_entry, if we fail to hit nat cache,
we try to load nat entries a) from journal of current segment cache or b)
from NAT pages for updating, during the process, write lock of
nat_tree_lock will be held to avoid inconsistent condition in between
nid cache and nat cache caused by racing among nat entry shrinker,
checkpointer, nat entry updater.
But this way may cause low efficient when updating nat cache, because it
serializes accessing in journal cache or reading NAT pages.
Here, we reorder lock and update flow as below to enhance accessing
concurrency:
- get_node_info
- down_read(nat_tree_lock)
- lookup nat cache --- hit -> unlock & return
- lookup journal cache --- hit -> unlock & goto update
- up_read(nat_tree_lock)
update:
- down_write(nat_tree_lock)
- cache_nat_entry
- lookup nat cache --- nohit -> update
- up_write(nat_tree_lock)
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
0 files changed, 0 insertions, 0 deletions