[PATCH] erofs: allocate more short-lived pages from reserved pool first
Gao Xiang
hsiangkao at linux.alibaba.com
Tue Sep 10 13:14:05 AEST 2024
On 2024/9/6 20:11, Chunhai Guo wrote:
> This patch aims to allocate bvpages and short-lived compressed pages
> from the reserved pool first.
>
> After applying this patch, there are three benefits.
>
> 1. It reduces the page allocation time.
> The bvpages and short-lived compressed pages account for about 4% of
> the pages allocated from the system in the multi-app launch benchmarks
> [1]. It reduces the page allocation time accordingly and lowers the
> likelihood of blockage by page allocation in low memory scenarios.
>
> 2. The pages in the reserved pool will be allocated on demand.
> Currently, bvpages and short-lived compressed pages are short-lived
> pages allocated from the system, and the pages in the reserved pool all
> originate from short-lived pages. Consequently, the number of reserved
> pool pages will increase to z_erofs_rsv_nrpages over time.
> With this patch, all short-lived pages are allocated from the reserved
> pool first, so the number of reserved pool pages will only increase when
> there are not enough pages. Thus, even if z_erofs_rsv_nrpages is set to
> a large number for specific reasons, the actual number of reserved pool
> pages may remain low as per demand. In the multi-app launch benchmarks
> [1], z_erofs_rsv_nrpages is set at 256, while the number of reserved
> pool pages remains below 64.
>
> 3. When erofs cache decompression is disabled
> (EROFS_ZIP_CACHE_DISABLED), all pages will *only* be allocated from
> the reserved pool for erofs. This will significantly reduce the memory
> pressure from erofs.
>
> [1] For additional details on the multi-app launch benchmarks, please
> refer to commit 0f6273ab4637 ("erofs: add a reserved buffer pool for lz4
> decompression").
>
> Signed-off-by: Chunhai Guo <guochunhai at vivo.com>
It looks good to me and it seems useful for the corner lagging
with little modification if reserved pool is used:
Reviewed-by: Gao Xiang <hsiangkao at linux.alibaba.com>
Thanks,
Gao Xiang
More information about the Linux-erofs
mailing list