mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yue Hu <zbestahu@gmail.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org,
	jefflexu@linux.alibaba.com, linux-kernel@vger.kernel.org,
	huyue2@coolpad.com, zhangwen@coolpad.com
Subject: Re: [PATCH] erofs: remove unneeded icur field from struct z_erofs_decompress_frontend
Date: Mon, 17 Apr 2023 15:44:15 +0800	[thread overview]
Message-ID: <20230417154415.00006a18.zbestahu@gmail.com> (raw)
In-Reply-To: <a8b9a758-d469-b9a6-f5e8-8f3768e2ea81@linux.alibaba.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB18030, Size: 2132 bytes --]

On Mon, 17 Apr 2023 15:12:31 +0800
Gao Xiang <hsiangkao@linux.alibaba.com> wrote:

> On 2023/4/17 15:15, Yue Hu wrote:
> > On Mon, 17 Apr 2023 15:00:25 +0800
> > Gao Xiang <hsiangkao@linux.alibaba.com> wrote:
> >   
> 
> ..
> 
> >>
> >> Although please help refine the comment below:
> >>
> >> 	/* scan & fill inplace I/O pages in the reverse order */  
> > 
> > Ok, will refine it in v2.  
> 
> I rethink this, I don't want to go far in this way, and this makes a
> O(n) scan into O(n^2) when a single inplace I/O page is added.

Yeah, i misread that, it should be global before submission, just ignore the change.

> 
> So sorry, I don't think it's a good way, although I also don't think
> `icur` is a good name and we might need to find a better name.
> 
> Thanks,
> Gao Xiang
> 
> >   
> >>
> >> Thanks,
> >> Gao Xiang
> >>  
> >>>> +0„20„20„2 unsigned int icur = pcl->pclusterpages;
> >>>> -0„20„20„2 while (fe->icur > 0) {
> >>>> -0„20„20„20„20„20„20„2 if (!cmpxchg(&pcl->compressed_bvecs[--fe->icur].page,
> >>>> +0„20„20„2 while (icur > 0) {
> >>>> +0„20„20„20„20„20„20„2 if (!cmpxchg(&pcl->compressed_bvecs[--icur].page,
> >>>>  0„20„20„20„20„20„20„20„20„20„20„20„20„20„20„20„20„20„2 NULL, bvec->page)) {
> >>>> -0„20„20„20„20„20„20„20„20„20„20„2 pcl->compressed_bvecs[fe->icur] = *bvec;
> >>>> +0„20„20„20„20„20„20„20„20„20„20„2 pcl->compressed_bvecs[icur] = *bvec;
> >>>>  0„20„20„20„20„20„20„20„20„20„20„20„20„2 return true;
> >>>>  0„20„20„20„20„20„20„20„20„2 }
> >>>>  0„20„20„20„20„2 }
> >>>> @@ -877,8 +876,6 @@ static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe)
> >>>>  0„20„20„20„20„2 }
> >>>>  0„20„20„20„20„2 z_erofs_bvec_iter_begin(&fe->biter, &fe->pcl->bvset,
> >>>>  0„20„20„20„20„20„20„20„20„20„20„20„20„20„20„20„20„2 Z_EROFS_INLINE_BVECS, fe->pcl->vcnt);
> >>>> -0„20„20„2 /* since file-backed online pages are traversed in reverse order */
> >>>> -0„20„20„2 fe->icur = z_erofs_pclusterpages(fe->pcl);
> >>>>  0„20„20„20„20„2 return 0;
> >>>>  0„2 }  


      reply	other threads:[~2023-04-17  7:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17  6:41 Yue Hu
2023-04-17  6:52 ` Gao Xiang
2023-04-17  7:00   ` Gao Xiang
2023-04-17  7:15     ` Yue Hu
2023-04-17  7:12       ` Gao Xiang
2023-04-17  7:44         ` Yue Hu [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=20230417154415.00006a18.zbestahu@gmail.com \
    --to=zbestahu@gmail.com \
    --cc=chao@kernel.org \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=huyue2@coolpad.com \
    --cc=jefflexu@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiang@kernel.org \
    --cc=zhangwen@coolpad.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

all inboxes | Powered by JetHome®