diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-04-15 18:28:48 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-04-15 23:36:58 -0400 |
commit | 9c5f1d30199d09f7e2776c24ecb63c843ada876d (patch) | |
tree | b00ee3a76635657ab4df363562f06b6d77af3521 | |
parent | 3a8e3611e0babd460bae2fa57674b9a208422217 (diff) |
dcache: move cond_resched() into the end of __dentry_kill()
cond_resched() in shrink_dentry_list() is too early
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/dcache.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index af645c20db40..fd4c6de17b94 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -580,6 +580,7 @@ static void __dentry_kill(struct dentry *dentry) | |||
580 | spin_unlock(&dentry->d_lock); | 580 | spin_unlock(&dentry->d_lock); |
581 | if (likely(can_free)) | 581 | if (likely(can_free)) |
582 | dentry_free(dentry); | 582 | dentry_free(dentry); |
583 | cond_resched(); | ||
583 | } | 584 | } |
584 | 585 | ||
585 | static struct dentry *__lock_parent(struct dentry *dentry) | 586 | static struct dentry *__lock_parent(struct dentry *dentry) |
@@ -849,7 +850,6 @@ repeat: | |||
849 | 850 | ||
850 | dentry = dentry_kill(dentry); | 851 | dentry = dentry_kill(dentry); |
851 | if (dentry) { | 852 | if (dentry) { |
852 | cond_resched(); | ||
853 | goto repeat; | 853 | goto repeat; |
854 | } | 854 | } |
855 | } | 855 | } |
@@ -1052,8 +1052,6 @@ static void shrink_dentry_list(struct list_head *list) | |||
1052 | while (!list_empty(list)) { | 1052 | while (!list_empty(list)) { |
1053 | struct dentry *dentry, *parent; | 1053 | struct dentry *dentry, *parent; |
1054 | 1054 | ||
1055 | cond_resched(); | ||
1056 | |||
1057 | dentry = list_entry(list->prev, struct dentry, d_lru); | 1055 | dentry = list_entry(list->prev, struct dentry, d_lru); |
1058 | spin_lock(&dentry->d_lock); | 1056 | spin_lock(&dentry->d_lock); |
1059 | rcu_read_lock(); | 1057 | rcu_read_lock(); |