From: Chao Yu <chao2.yu@samsung.com>
To: "'Jaegeuk Kim'" <jaegeuk@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: RE: [f2fs-dev] [PATCH 1/5] f2fs: do retry operations with cond_resched
Date: Mon, 08 Dec 2014 17:29:53 +0800 [thread overview]
Message-ID: <002101d012c9$a1d85460$e588fd20$@samsung.com> (raw)
In-Reply-To: <1417895739-15251-1-git-send-email-jaegeuk@kernel.org>
> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Sunday, December 07, 2014 3:56 AM
> To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org;
> linux-f2fs-devel@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 1/5] 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>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
> ---
> fs/f2fs/f2fs.h | 7 +++++++
> fs/f2fs/gc.c | 5 ++---
> fs/f2fs/node.c | 41 +++++++++--------------------------------
> fs/f2fs/segment.c | 5 ++---
> 4 files changed, 20 insertions(+), 38 deletions(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index c873140..c787fe3 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -1021,6 +1021,13 @@ retry:
> return entry;
> }
>
> +static inline void f2fs_radix_tree_insert(struct radix_tree_root *root,
> + unsigned long index, void *item)
> +{
> + while (radix_tree_insert(root, index, item))
> + cond_resched();
> +}
> +
> #define RAW_IS_INODE(p) ((p)->footer.nid == (p)->footer.ino)
>
> static inline bool IS_INODE(struct page *page)
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 2c58c58..eec0933 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;
> }
use f2fs_radix_tree_insert instead?
Thanks,
Yu
prev parent reply other threads:[~2014-12-08 9:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-06 19:55 Jaegeuk Kim
2014-12-06 19:55 ` [PATCH 2/5] f2fs: count inline_xx in do_read_inode Jaegeuk Kim
2014-12-06 19:55 ` [PATCH 3/5] f2fs: set page private for inmemory pages for truncation Jaegeuk Kim
2014-12-06 19:55 ` [PATCH 4/5] f2fs: release inmemory pages when the file was closed Jaegeuk Kim
2014-12-06 19:55 ` [PATCH 5/5] f2fs: count the number of inmemory pages Jaegeuk Kim
2014-12-08 9:29 ` Chao Yu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002101d012c9$a1d85460$e588fd20$@samsung.com' \
--to=chao2.yu@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®