[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d1e4c851-b399-4d6b-9e0b-4124ef7bbf64@linux.alibaba.com>
Date: Thu, 16 Jan 2025 16:45:25 +0800
From: Gao Xiang <hsiangkao@...ux.alibaba.com>
To: Chen Linxuan <chenlinxuan@...ontech.com>, Gao Xiang <xiang@...nel.org>,
Chao Yu <chao@...nel.org>, Yue Hu <zbestahu@...il.com>,
Jeffle Xu <jefflexu@...ux.alibaba.com>, Sandeep Dhavale <dhavale@...gle.com>
Cc: linux-erofs@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] erofs(shrinker): return SHRINK_EMPTY if no objects to
free
On 2025/1/16 16:24, Chen Linxuan wrote:
> On Thu, 2025-01-16 at 15:51 +0800, Gao Xiang wrote:
>> Hi Linxuan,
>>
>> On 2025/1/16 15:20, Chen Linxuan wrote:
>>> Comments in file include/linux/shrinker.h says that
>>> `count_objects` of `struct shrinker` should return SHRINK_EMPTY
>>> when there are no objects to free.
>>>
>>>> If there are no objects to free, it should return SHRINK_EMPTY,
>>>> while 0 is returned in cases of the number of freeable items cannot
>>>> be determined or shrinker should skip this cache for this time
>>>> (e.g., their number is below shrinkable limit).
>>
>> Thanks for the patch!
>>
>> Yeah, it seems that is the case. Yet it'd better to document
>> what the impact if 0 is returned here if you know more..
>
> Sorry, I have no idea about that.
I guess it has no difference if the shrinker is not memcg-aware,
see:
https://lore.kernel.org/r/153063070859.1818.11870882950920963480.stgit@localhost.localdomain
But I'm fine to use SHRINK_EMPTY since it's clearly documented.
So could you resend a patch to address my suggestion?
Thanks,
Gao Xiang
Powered by blists - more mailing lists