[PATCH] erofs: allocate extra bvec pages from reserved buffer pool first by default

Chunhai Guo guochunhai at vivo.com
Wed Aug 14 21:35:32 AEST 2024


在 2024/8/14 10:35, Gao Xiang 写道:
> Hi Chunhai,
>
> On 2024/8/13 18:27, Chunhai Guo wrote:
>> As the extra bvec pages are allocated and freed in a short time, it can
> It'd be better to just simplify the subject
> erofs: allocate bvpages from reserved buffer pool first
Got it. I will change it.

>> reduce the page allocation time by first allocating pages from the
>> reserved buffer pool [1].
>>
>> [1] The reserved buffer pool and its benefits are detailed in
> Although I can imagine it could have some benefits, but if it's
> possible, could you give some real numbers for this commit (assume
> that it's not hard) so that we could record them in the commit
> message for other reference?
I do not have a good number for it now. While the modification is minor 
and without any side effects. I suggest that we make the change.

Thanks,

>> commit 0f6273ab4637 ("erofs: add a reserved buffer pool for lz4
>> decompression").
>>
>> Signed-off-by: Chunhai Guo <guochunhai at vivo.com>
> The patch itself looks good to me tho.
>
> Thanks,
> Gao Xiang
>
>> ---
>>    fs/erofs/zdata.c | 3 ++-
>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
>> index b979529be5ed..428ab617e0e4 100644
>> --- a/fs/erofs/zdata.c
>> +++ b/fs/erofs/zdata.c
>> @@ -232,7 +232,8 @@ static int z_erofs_bvec_enqueue(struct z_erofs_bvec_iter *iter,
>>    		struct page *nextpage = *candidate_bvpage;
>>    
>>    		if (!nextpage) {
>> -			nextpage = erofs_allocpage(pagepool, GFP_KERNEL);
>> +			nextpage = __erofs_allocpage(pagepool, GFP_KERNEL,
>> +					true);
>>    			if (!nextpage)
>>    				return -ENOMEM;
>>    			set_page_private(nextpage, Z_EROFS_SHORTLIVED_PAGE);




More information about the Linux-erofs mailing list