[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1dcc9969-da5b-4384-96d8-d03c835f198e@linux.dev>
Date: Tue, 31 Oct 2023 10:50:33 +0800
From: Chengming Zhou <chengming.zhou@...ux.dev>
To: Christoph Lameter <cl@...ux.com>, vbabka@...e.cz
Cc: penberg@...nel.org, rientjes@...gle.com, iamjoonsoo.kim@....com,
akpm@...ux-foundation.org, roman.gushchin@...ux.dev,
42.hyeyoo@...il.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Chengming Zhou <zhouchengming@...edance.com>
Subject: Re: [RFC PATCH v3 0/7] slub: Delay freezing of CPU partial slabs
On 2023/10/31 03:25, Christoph Lameter wrote:
> On Sat, 28 Oct 2023, Chengming Zhou wrote:
>
>> 2. But for full slab (slab->freelist == NULL), PG_workingset is not much useful, we don't
>> safely know whether it's used as the cpu slab or not just from this flag. So __slab_free()
>> still rely on the "frozen" bit to know it.
>>
>> 3. And the maintaining of "frozen" has no extra cost now, since it's changed together with "freelist"
>> and other counter using cmpxchg, we already have the cmpxchg when start to use a slab as the cpu slab.
>>
>> Maybe I missed something, I don't know how to drop the frozen flag.
>
>
> Maybe frozen is now = PG_Workingset | cmpxchg-frozen?
>
>
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
- cpu slabs: !PG_Workingset && frozen (set or clear using cmpxchg together with freelist)
- full slabs: !PG_Workingset
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!
Powered by blists - more mailing lists