Re: [RFC PATCH v3 1/7] slub: Keep track of whether slub is on the per-node partial list

From: Chengming Zhou
Date: Fri Oct 27 2023 - 21:31:56 EST


On 2023/10/27 23:09, Vlastimil Babka wrote:
> On 10/24/23 11:33, chengming.zhou@xxxxxxxxx wrote:
>> From: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
>>
>> Now we rely on the "frozen" bit to see if we should manipulate the
>> slab->slab_list, which will be changed in the following patch.
>>
>> Instead we introduce another way to keep track of whether slub is on
>> the per-node partial list, here we reuse the PG_workingset bit.
>>
>> We use __set_bit and __clear_bit directly instead of the atomic version
>> for better performance and it's safe since it's protected by the slub
>> node list_lock.
>>
>> Signed-off-by: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
>> ---
>> mm/slab.h | 19 +++++++++++++++++++
>> mm/slub.c | 3 +++
>> 2 files changed, 22 insertions(+)
>>
>> diff --git a/mm/slab.h b/mm/slab.h
>> index 8cd3294fedf5..50522b688cfb 100644
>> --- a/mm/slab.h
>> +++ b/mm/slab.h
>
> I think these helper might just go to mm/slub.c as nothing else would use them.
>

Ok.

>> @@ -193,6 +193,25 @@ static inline void __slab_clear_pfmemalloc(struct slab *slab)
>> __folio_clear_active(slab_folio(slab));
>> }
>>
>> +/*
>> + * Slub reuse PG_workingset bit to keep track of whether it's on
>
> "SLUB reuses" ...
>
> Looks fine otherwise!
>

Will fix it. Thanks!