lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04cbf4cd-3f62-9068-b4fd-c90158f2f116@suse.cz>
Date:   Mon, 30 Oct 2023 17:19:21 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Chengming Zhou <chengming.zhou@...ux.dev>,
        Christoph Lameter <cl@...ux.com>
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 10/28/23 04:36, Chengming Zhou wrote:
>> 
>> 
>> After this patch the PG_workingset indicates the state of being on the partial lists.
>> 
>> What does "frozen slab" then mean? The slab is being allocated from? Is that information useful or can we drop the frozen flag?
> 
> Right, frozen slab is the cpu slab, which is being allocated from by the cpu that froze it.
> 
> IMHO, the "frozen" bit is useful because:
> 
> 1. PG_workingset is only useful on partial slab, which indicates the slab is on the node
>    partial list, so we can manipulate its list in the __slab_free() path.
> 
> 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.

Well, we could extend the meaning of PG_workingset to mean "not a cpu slab
or pecpu partial slab" i.e. both on node partial list and full. However it
would increase the number of cases where __slab_free() has to lock the
list_lock and check the PG_working set. "slab->freelist == NULL" might
happen often exactly because the freelist became cpu freelist.

> 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.

And together with this point, I don't see a reason to drop the frozen bit.
It's still useful for cpu slabs. It just wasn't the best possible solution
for percpu partial slabs.

> Maybe I missed something, I don't know how to drop the frozen flag.

Should be possible, but not worth it IMHO.

>> 
>> Update the definition?
>> 
> 
> Ok, will add a cleanup patch to update.
> 
> Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ