提交 9560ba30 编写于 作者: G Greg Thelen 提交者: Jan Kara

quota: reclaim least recently used dquots

The dquots in the free_dquots list are not reclaimed in LRU way.
put_dquot_last() puts entries to the tail and dqcache_shrink_scan()
frees from the tail. Free unreferenced dquots in LRU order because it
seems more reasonable than freeing most recently used.
Signed-off-by: NGreg Thelen <gthelen@google.com>
Signed-off-by: NShakeel Butt <shakeelb@google.com>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 81e97f01
...@@ -716,7 +716,7 @@ dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) ...@@ -716,7 +716,7 @@ dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
unsigned long freed = 0; unsigned long freed = 0;
spin_lock(&dq_list_lock); spin_lock(&dq_list_lock);
head = free_dquots.prev; head = free_dquots.next;
while (head != &free_dquots && sc->nr_to_scan) { while (head != &free_dquots && sc->nr_to_scan) {
dquot = list_entry(head, struct dquot, dq_free); dquot = list_entry(head, struct dquot, dq_free);
remove_dquot_hash(dquot); remove_dquot_hash(dquot);
...@@ -725,7 +725,7 @@ dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) ...@@ -725,7 +725,7 @@ dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
do_destroy_dquot(dquot); do_destroy_dquot(dquot);
sc->nr_to_scan--; sc->nr_to_scan--;
freed++; freed++;
head = free_dquots.prev; head = free_dquots.next;
} }
spin_unlock(&dq_list_lock); spin_unlock(&dq_list_lock);
return freed; return freed;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册