linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@redhat.com>
To: Chao Yu <yuchao0@huawei.com>, Huang Jianan <huangjianan@oppo.com>
Cc: zhangshiming@oppo.com, linux-erofs@lists.ozlabs.org,
	guoweichao@oppo.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/2] erofs: avoid memory allocation failure during rolling decompression
Date: Tue, 16 Mar 2021 09:29:11 +0800	[thread overview]
Message-ID: <20210316012911.GA931077@xiangao.remote.csb> (raw)
In-Reply-To: <110aa688-515d-7569-80fc-546bbeedc8c5@huawei.com>

On Tue, Mar 16, 2021 at 09:11:02AM +0800, Chao Yu wrote:
> On 2021/3/5 17:58, Huang Jianan via Linux-erofs wrote:
> > Currently, err would be treated as io error. Therefore, it'd be
> > better to ensure memory allocation during rolling decompression
> > to avoid such io error.
> > 
> > In the long term, we might consider adding another !Uptodate case
> > for such case.
> > 
> > Signed-off-by: Huang Jianan <huangjianan@oppo.com>
> > Signed-off-by: Guo Weichao <guoweichao@oppo.com>
> > ---
> >   fs/erofs/decompressor.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
> > index 1cb1ffd10569..3d276a8aad86 100644
> > --- a/fs/erofs/decompressor.c
> > +++ b/fs/erofs/decompressor.c
> > @@ -73,7 +73,8 @@ static int z_erofs_lz4_prepare_destpages(struct z_erofs_decompress_req *rq,
> >   			victim = availables[--top];
> >   			get_page(victim);
> >   		} else {
> > -			victim = erofs_allocpage(pagepool, GFP_KERNEL);
> > +			victim = erofs_allocpage(pagepool,
> > +						 GFP_KERNEL | __GFP_NOFAIL);
> >   			if (!victim)
> >   				return -ENOMEM;
> 
> A little bit weird that we still need to check return value of erofs_allocpage()
> after we pass __GFP_NOFAIL parameter.

Yeah, good point! sorry I forgot that.

Jianan,
Could you take some time resending the next version with all new things
updated?... thus Chao could review easily, Thanks!

Thanks,
Gao Xiang

> 
> Thanks,
> 
> >   			set_page_private(victim, Z_EROFS_SHORTLIVED_PAGE);
> > 
> 


      reply	other threads:[~2021-03-16  1:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05  6:22 [PATCH 1/2] erofs: avoid memory allocation failure during rolling decompression Huang Jianan via Linux-erofs
2021-03-05  6:22 ` [PATCH 2/2] erofs: decompress in endio if possible Huang Jianan via Linux-erofs
2021-03-05  6:41   ` Gao Xiang
2021-03-05  8:21   ` kernel test robot
2021-03-05  6:45 ` [PATCH 1/2] erofs: avoid memory allocation failure during rolling decompression Gao Xiang
2021-03-05  9:58 ` [PATCH v5 " Huang Jianan via Linux-erofs
2021-03-05  9:58   ` [PATCH v5 2/2] erofs: decompress in endio if possible Huang Jianan via Linux-erofs
2021-03-15 11:28     ` Gao Xiang
2021-03-15 11:24   ` [PATCH v5 1/2] erofs: avoid memory allocation failure during rolling decompression Gao Xiang
2021-03-16  1:11   ` Chao Yu
2021-03-16  1:29     ` Gao Xiang [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=20210316012911.GA931077@xiangao.remote.csb \
    --to=hsiangkao@redhat.com \
    --cc=guoweichao@oppo.com \
    --cc=huangjianan@oppo.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchao0@huawei.com \
    --cc=zhangshiming@oppo.com \
    /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).