From: Chao Yu <yuchao0@huawei.com>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, chao@kernel.org
Subject: Re: [PATCH] f2fs: retry to revoke atomic commit in -ENOMEM case
Date: Fri, 11 Aug 2017 09:12:02 +0800 [thread overview]
Message-ID: <cbab44fc-e3bb-5579-d15d-07fa8af2bad8@huawei.com> (raw)
In-Reply-To: <20170808110908.108562-1-yuchao0@huawei.com>
Ping,
On 2017/8/8 19:09, Chao Yu wrote:
> During atomic committing, if we encounter -ENOMEM in revoke path, it's
> better to give a chance to retry revoking.
>
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
> fs/f2fs/segment.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 45fb53411032..682ae68b9ef7 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -213,9 +213,15 @@ static int __revoke_inmem_pages(struct inode *inode,
> struct node_info ni;
>
> trace_f2fs_commit_inmem_page(page, INMEM_REVOKE);
> -
> +retry:
> set_new_dnode(&dn, inode, NULL, NULL, 0);
> - if (get_dnode_of_data(&dn, page->index, LOOKUP_NODE)) {
> + err = get_dnode_of_data(&dn, page->index, LOOKUP_NODE);
> + if (err) {
> + if (err == -ENOMEM) {
> + congestion_wait(BLK_RW_ASYNC, HZ/50);
> + cond_resched();
> + goto retry;
> + }
> err = -EAGAIN;
> goto next;
> }
>
next prev parent reply other threads:[~2017-08-11 1:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 11:09 [PATCH] f2fs: retry to revoke atomic commit in -ENOMEM case Chao Yu
2017-08-11 1:12 ` Chao Yu [this message]
2017-08-11 1:14 ` Jaegeuk Kim
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=cbab44fc-e3bb-5579-d15d-07fa8af2bad8@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;
as well as URLs for NNTP newsgroup(s).