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>
This commit is contained in:
@@ -179,13 +179,13 @@ void register_inmem_page(struct inode *inode, struct page *page)
|
||||
struct f2fs_inode_info *fi = F2FS_I(inode);
|
||||
struct inmem_pages *new;
|
||||
int err;
|
||||
retry:
|
||||
|
||||
new = f2fs_kmem_cache_alloc(inmem_entry_slab, GFP_NOFS);
|
||||
|
||||
/* add atomic page indices to the list */
|
||||
new->page = page;
|
||||
INIT_LIST_HEAD(&new->list);
|
||||
|
||||
retry:
|
||||
/* increase reference count with clean state */
|
||||
mutex_lock(&fi->inmem_lock);
|
||||
err = radix_tree_insert(&fi->inmem_root, page->index, new);
|
||||
@@ -195,7 +195,6 @@ retry:
|
||||
return;
|
||||
} else if (err) {
|
||||
mutex_unlock(&fi->inmem_lock);
|
||||
kmem_cache_free(inmem_entry_slab, new);
|
||||
goto retry;
|
||||
}
|
||||
get_page(page);
|
||||
|
Reference in New Issue
Block a user