From: Chao Yu <yuchao0@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH 1/4] f2fs: flush journal nat entries for nat_bits during unmount
Date: Tue, 10 Jul 2018 14:01:22 +0800 [thread overview]
Message-ID: <e50c1305-ef02-0380-ca2a-3760247f0d64@huawei.com> (raw)
In-Reply-To: <20180709204306.GD24534@jaegeuk-macbookpro.roam.corp.google.com>
On 2018/7/10 4:43, Jaegeuk Kim wrote:
> On 07/09, Chao Yu wrote:
>> On 2018/7/7 5:09, Jaegeuk Kim wrote:
>>> Let's flush journal nat entries for speed up in the next run.
>>>
>>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>>> ---
>>> fs/f2fs/node.c | 7 +++++++
>>> 1 file changed, 7 insertions(+)
>>>
>>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
>>> index 29237aeca041..0f076fb0d828 100644
>>> --- a/fs/f2fs/node.c
>>> +++ b/fs/f2fs/node.c
>>> @@ -2613,6 +2613,13 @@ void f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
>>> nid_t set_idx = 0;
>>> LIST_HEAD(sets);
>>>
>>> + /* during unmount, let's flush nat_bits before checking dirty_nat_cnt */
>>> + if (enabled_nat_bits(sbi, cpc)) {
>>> + down_write(&nm_i->nat_tree_lock);
>>> + remove_nats_in_journal(sbi);
>>> + up_write(&nm_i->nat_tree_lock);
>>> + }
>>
>> The case will cover that nm_i->dirty_nat_cnt is zero and there is cached nats in
>> journal?
>
> Yes.
>
>>
>> So enabled_nat_bits() below should be removed?
>
> It's out of lock, nm_i->nat_tree_lock, logically..
CP_NAT_BITS_FLAG modification should be happened in mount or checkpoint, so
there should be no contention.
Anyway, keep it here is okay to me.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
>
>>
>> if (enabled_nat_bits(sbi, cpc) ||
>> !__has_cursum_space(journal, nm_i->dirty_nat_cnt, NAT_JOURNAL))
>> remove_nats_in_journal(sbi);
>>
>> Thanks,
>>
>>> +
>>> if (!nm_i->dirty_nat_cnt)
>>> return;
>>>
>>>
>
> .
>
prev parent reply other threads:[~2018-07-10 6:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-06 21:09 Jaegeuk Kim
2018-07-06 21:09 ` [PATCH 2/4] f2fs: allow wrong configure dio to buffered write Jaegeuk Kim
2018-07-09 14:33 ` [f2fs-dev] " Chao Yu
2018-07-09 20:41 ` Jaegeuk Kim
2018-07-10 5:54 ` Chao Yu
2018-07-12 17:59 ` [f2fs-dev v2] " Jaegeuk Kim
2018-07-13 11:29 ` Chao Yu
2018-07-06 21:09 ` [PATCH 3/4] f2fs: indicate shutdown f2fs to allow unmount successfully Jaegeuk Kim
2018-07-09 14:42 ` [f2fs-dev] " Chao Yu
2018-07-06 21:09 ` [PATCH 4/4] f2fs: should check the type of end_io after pullback by fscrypto Jaegeuk Kim
2018-07-09 14:54 ` [f2fs-dev] " Chao Yu
2018-07-09 20:37 ` Jaegeuk Kim
2018-07-10 20:43 ` Jaegeuk Kim
2018-07-10 20:53 ` Jaegeuk Kim
2018-07-09 14:23 ` [f2fs-dev] [PATCH 1/4] f2fs: flush journal nat entries for nat_bits during unmount Chao Yu
2018-07-09 20:43 ` Jaegeuk Kim
2018-07-10 6:01 ` 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=e50c1305-ef02-0380-ca2a-3760247f0d64@huawei.com \
--to=yuchao0@huawei.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--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®