Re: [PATCH 1/1] erofs: fix unused pcluster_pools for higher page sizes
From: Gao Xiang
Date: Sun Aug 16 2026 - 21:35:20 EST
Hi Ojaswin,
On Sun, Aug 16, 2026 at 06:37:09PM +0530, Ojaswin Mujoo wrote:
> pcluster_pool[] hardcodes {1,4,16,64,128,Z_EROFS_PCLUSTER_MAX_PAGES+1},
> but the assumption of Z_EROFS_PCLUSTER_MAX_PAGES == 256 is only right
> for 4k page sizes. For higher page sizes like 16k or 64k, This results
> in us ending up with clusters bigger than what we will ever use, since
> we only support upto 1MB of compressed data. For example, on 64k page
> size we will only ever use clusters with nrpages= 1, 4 and 17.
>
> This patch fixes the allocation for such higher pages sizes by adding
> some compile time checks.
>
> Below are the clusters created right after boot on a 64KB page size
> machine
>
> $cat /proc/slabinfo | grep pcluster | cut -d" " -f1:
>
> Before the patch:
>
> erofs_pcluster-1
> erofs_pcluster-4
> erofs_pcluster-16
> erofs_pcluster-17
> erofs_pcluster-64
> erofs_pcluster-128
>
>
> After the patch:
>
> erofs_pcluster-1
> erofs_pcluster-4
> erofs_pcluster-17
>
> Fixes: 9f6cc76e6ff0 ("erofs: introduce physical cluster slab pools")
> Reported-by: Shirisha G <shirisha@xxxxxxxxxxxxx>
> Signed-off-by: Ojaswin Mujoo <ojaswin@xxxxxxxxxxxxx>
Thanks for catching this, looks fine to me:
Reviewed-by: Gao Xiang <xiang@xxxxxxxxxx>
Thanks,
Gao Xiang