[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201208082837.GC3006985@xiangao.remote.csb>
Date: Tue, 8 Dec 2020 16:28:37 +0800
From: Gao Xiang <hsiangkao@...hat.com>
To: Chao Yu <yuchao0@...wei.com>
Cc: linux-erofs@...ts.ozlabs.org, LKML <linux-kernel@...r.kernel.org>,
Chao Yu <chao@...nel.org>
Subject: Re: [PATCH v2 1/3] erofs: get rid of magical Z_EROFS_MAPPING_STAGING
On Tue, Dec 08, 2020 at 04:15:59PM +0800, Chao Yu wrote:
> On 2020/12/7 9:23, Gao Xiang wrote:
...
> > }
> > -static inline bool z_erofs_put_stagingpage(struct list_head *pagepool,
> > - struct page *page)
> > +static inline bool z_erofs_put_shortlivedpage(struct list_head *pagepool,
> > + struct page *page)
> > {
> > - if (!z_erofs_page_is_staging(page))
> > + if (!z_erofs_is_shortlived_page(page))
> > return false;
> > - /* staging pages should not be used by others at the same time */
> > - if (page_ref_count(page) > 1)
> > + /* short-lived pages should not be used by others at the same time */
> > + if (page_ref_count(page) > 1) {
>
> Does this be a possible case?
Add more words about this.... since EROFS uses rolling decompression (which means
the sliding window is limited (e.g. 64k, but some vendors adjust it to 12k for
example ) even though the uncompressed size is too large (e.g. 128k)), and by
using get_page(), vmap(), and z_erofs_put_shortlivedpage() to free such usage.
Since shortlivedpages won't share with other parallel thread, so it's safe to
just like this to decrease page count (it means how many shared get_page()
before) and recycle to pagepool (on the last reference for later use.)
Thanks,
Gao Xiang
Powered by blists - more mailing lists