From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com
Cc: Daeho Jeong <daehojeong@google.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix deadlock between quota writes and checkpoint
Date: Wed, 29 Jul 2020 20:42:25 +0800 [thread overview]
Message-ID: <054f161c-05db-73b7-3d83-be7addcd6015@kernel.org> (raw)
In-Reply-To: <20200729070244.584518-1-jaegeuk@kernel.org>
On 2020-7-29 15:02, Jaegeuk Kim wrote:
> f2fs_write_data_pages(quota_mapping)
> __f2fs_write_data_pages f2fs_write_checkpoint
> * blk_start_plug(&plug);
> * add bio in write_io[DATA]
> - block_operations
> - skip syncing quota by
> >DEFAULT_RETRY_QUOTA_FLUSH_COUNT
> - down_write(&sbi->node_write);
> - f2fs_write_single_data_page
After commit 79963d967b49 ("f2fs: shrink node_write lock coverage"),
node_write lock was moved to f2fs_write_single_data_page() and
f2fs_write_compressed_pages().
So it needs to update the callstack.
- down_write(node_write)
Otherwise it looks good to me.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
> - f2fs_do_write_data_page
> - f2fs_outplace_write_data
> - do_write_page
> - f2fs_allocate_data_block
> - down_write(node_write)
> - f2fs_wait_on_all_pages(F2FS_WB_CP_DATA);
>
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/checkpoint.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 8c782d3f324f0..99c8061da55b9 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -1269,6 +1269,8 @@ void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type)
> if (type == F2FS_DIRTY_META)
> f2fs_sync_meta_pages(sbi, META, LONG_MAX,
> FS_CP_META_IO);
> + else if (type == F2FS_WB_CP_DATA)
> + f2fs_submit_merged_write(sbi, DATA);
> io_schedule_timeout(DEFAULT_IO_TIMEOUT);
> }
> finish_wait(&sbi->cp_wait, &wait);
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2020-07-29 12:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 7:02 [f2fs-dev] [PATCH] f2fs: fix deadlock between quota writes and checkpoint Jaegeuk Kim
2020-07-29 12:42 ` Chao Yu [this message]
2020-07-29 16:21 ` Jaegeuk Kim
2020-08-01 19:22 ` Eric Biggers
2020-08-04 3:01 ` Chao Yu
2020-08-04 3:54 ` Jaegeuk Kim
2020-08-04 7:57 ` Chao Yu
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=054f161c-05db-73b7-3d83-be7addcd6015@kernel.org \
--to=chao@kernel.org \
--cc=daehojeong@google.com \
--cc=jaegeuk@kernel.org \
--cc=kernel-team@android.com \
--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;
as well as URLs for NNTP newsgroup(s).