From: Chao Yu <chao2.yu@samsung.com>
To: 'Fan Li' <fanofcode.li@samsung.com>, jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: optimize code of f2fs_update_extent_tree_range
Date: Wed, 09 Sep 2015 17:17:19 +0800 [thread overview]
Message-ID: <007901d0eae0$6c5666c0$45033440$@samsung.com> (raw)
In-Reply-To: <000001d0eaa7$122161c0$36642540$@samsung.com>
> -----Original Message-----
> From: Fan Li [mailto:fanofcode.li@samsung.com]
> Sent: Wednesday, September 09, 2015 10:27 AM
> To: jaegeuk@kernel.org
> Cc: linux-f2fs-devel@lists.sourceforge.net
> Subject: [f2fs-dev] [PATCH] f2fs: optimize code of f2fs_update_extent_tree_range
>
>
> Fix two potential problems:
> 1. when largest extent needs to be invalidated, it will be reset in
> __drop_largest_extent, which makes __is_extent_same after always
> return false, and largest extent unchanged. Now we update it properly.
>
> 2. When extent is split and the latter part remains in tree, next_en
> should be the latter part instead of next extent of original extent.
> It will cause merge failure if there is in-place update, although
> there is not, I think this fix will still makes codes less ambiguous.
>
> This patch also simpfies codes of invalidating extents, and optimizes the
> procedues that split extent into two.
>
>
> Signed-off-by: Fan li <fanofcode.li@samsung.com>
> ---
> fs/f2fs/extent_cache.c | 150
> +++++++++++++++++++-----------------------------
> 1 file changed, 58 insertions(+), 92 deletions(-)
>
> diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c
> index 997ac86..b95cfb3 100644
> --- a/fs/f2fs/extent_cache.c
> +++ b/fs/f2fs/extent_cache.c
> @@ -399,7 +399,7 @@ unsigned int f2fs_update_extent_tree_range(struct inode
> *inode,
> {
> struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
> struct extent_tree *et = F2FS_I(inode)->extent_tree;
> - struct extent_node *en = NULL, *en1 = NULL, *en2 = NULL, *en3 =
> NULL;
This patch is out of format, I guess your email client was set with
"auto line wrap" option. Can you fix and resend the patch?
> + struct extent_node *en = NULL, *en1 = NULL;
> struct extent_node *prev_en = NULL, *next_en = NULL;
> struct extent_info ei, dei, prev;
> struct rb_node **insert_p = NULL, *insert_parent = NULL;
> @@ -419,9 +419,6 @@ unsigned int f2fs_update_extent_tree_range(struct inode
> *inode,
> prev = et->largest;
> dei.len = 0;
>
> - /* we do not guarantee that the largest extent is cached all the
> time */
> - __drop_largest_extent(inode, fofs);
I think we should keep this, since in shrink flow, we will not update largest
info in inode's extent tree, that means largest extent will be remained if
related extent node has been shrunk. So here if we do not drop largest extent
when fofs located in largest extent, our mapping info in dnode page and largest
extent in cache will be consistent. How do you think?
Thanks,
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
prev parent reply other threads:[~2015-09-09 9:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 2:26 [PATCH] f2fs: optimize code of f2fs_update_extent_tree_range Fan Li
2015-09-09 9:17 ` 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='007901d0eae0$6c5666c0$45033440$@samsung.com' \
--to=chao2.yu@samsung.com \
--cc=fanofcode.li@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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;
as well as URLs for NNTP newsgroup(s).