On Mon, 17 Apr 2023 15:12:31 +0800 Gao Xiang <[email protected]> wrote:
> On 2023/4/17 15:15, Yue Hu wrote: > > On Mon, 17 Apr 2023 15:00:25 +0800 > > Gao Xiang <[email protected]> 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 }
