lkml.org 
[lkml]   [2023]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v3 0/7] slub: Delay freezing of CPU partial slabs
From
On 2023/10/31 11:47, Christoph Lameter wrote:
> On Tue, 31 Oct 2023, Chengming Zhou wrote:
>
>> The current scheme (which this series implemented) is:
>>
>> - node partial slabs: PG_Workingset (set or clear with per-node list_lock protection)
>> - cpu partial slabs: !PG_Workingset
>
> And then the frozen flag needs to be set. Otherwise slab_free() would conclude it is on a partial list?
>

- cpu partial slabs: !PG_Workingset && !frozen

Here comes the optimization that "frozen" is not set for the cpu partial slabs,
slab_free() will grab node list_lock then check by !PG_Workingset that it's not
on a node partial list.

>> - cpu slabs: !PG_Workingset && frozen (set or clear using cmpxchg together with freelist)
>
>
>
>> - full slabs: !PG_Workingset
>
> And frozen is clear? Otherwise it is the same as a cpu partial slab.
>

Right, - full slabs: !PG_Workingset && !frozen

Yes, it's the same as a cpu partial slab from only these two flags, but
slab_free() also know whether it was full or not.

>> As Vlastimil noted, it's possible to drop "frozen" bit for cpu slabs, but
>> we keep it for performance, since we don't need to grab node list_lock to
>> check whether PG_Workingset is set or not if the "frozen" bit is set.
>>
>> Thanks!
>>

\
 
 \ /
  Last update: 2023-10-31 05:58    [W:0.082 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site