diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-12-05 10:39:49 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-12-08 10:35:05 -0800 |
commit | 9be32d72becca41d7d9b010d7d9be1d39489414f (patch) | |
tree | 7ac34f8b38e3db9411a175b4e5f0ee810c57d7ef /fs/f2fs/gc.c | |
parent | 769ec6e5b7d4a8115447736871be8bffaaba3a7d (diff) | |
download | linux-9be32d72becca41d7d9b010d7d9be1d39489414f.tar.bz2 |
f2fs: do retry operations with cond_resched
This patch revists retrial paths in f2fs.
The basic idea is to use cond_resched instead of retrying from the very early
stage.
Suggested-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 2c58c587a3c6..eec0933a4819 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -356,12 +356,11 @@ static void add_gc_inode(struct gc_inode_list *gc_list, struct inode *inode) iput(inode); return; } -retry: new_ie = f2fs_kmem_cache_alloc(winode_slab, GFP_NOFS); new_ie->inode = inode; - +retry: if (radix_tree_insert(&gc_list->iroot, inode->i_ino, new_ie)) { - kmem_cache_free(winode_slab, new_ie); + cond_resched(); goto retry; } list_add_tail(&new_ie->list, &gc_list->ilist); |