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: <b8a5cba5-e01e-4627-b775-85928edb1722@linux.dev>
Date:   Thu, 2 Nov 2023 10:48:10 +0800
From:   Chengming Zhou <chengming.zhou@...ux.dev>
To:     Vlastimil Babka <vbabka@...e.cz>, cl@...ux.com, penberg@...nel.org,
        willy@...radead.org
Cc:     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 v4 9/9] slub: Update frozen slabs documentations in
 the source

On 2023/11/1 21:51, Vlastimil Babka wrote:
> On 10/31/23 15:07, chengming.zhou@...ux.dev wrote:
>> From: Chengming Zhou <zhouchengming@...edance.com>
>>
>> The current updated scheme (which this series implemented) is:
>>  - node partial slabs: PG_Workingset && !frozen
>>  - cpu partial slabs: !PG_Workingset && !frozen
>>  - cpu slabs: !PG_Workingset && frozen
>>  - full slabs: !PG_Workingset && !frozen
> 
> It could be useful to put this also to the initial comment description.
> Towards the end of the comment, there's a block explaining
> "slab->frozen". It could be extended to cover all 4 combination (but not
> all of them need such long explanation).
> 

Ok, I will extend it and put in the cover letter of v5.

>>
>> The most important change is that "frozen" bit is not set for the
>> cpu partial slabs anymore, __slab_free() will grab node list_lock
>> then check by !PG_Workingset that it's not on a node partial list.
>>
>> And the "frozen" bit is still kept for the cpu slabs for performance,
>> since we don't need to grab node list_lock to check whether the
>> PG_Workingset is set or not if the "frozen" bit is set in __slab_free().
>>
>> Update related documentations and comments in the source.
>>
>> Signed-off-by: Chengming Zhou <zhouchengming@...edance.com>
>> ---
>>  mm/slub.c | 16 ++++++++++++----
>>  1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/mm/slub.c b/mm/slub.c
>> index bb7368047103..89d3f7a18a73 100644
>> --- a/mm/slub.c
>> +++ b/mm/slub.c
>> @@ -76,13 +76,22 @@
>>   *
>>   *   Frozen slabs
>>   *
>> - *   If a slab is frozen then it is exempt from list management. It is not
>> - *   on any list except per cpu partial list. The processor that froze the
>> + *   If a slab is frozen then it is exempt from list management. It is
>> + *   the cpu slab which is actively allocated from by the processor that
>> + *   froze it and it is not on any list. The processor that froze the
>>   *   slab is the one who can perform list operations on the slab. Other
>>   *   processors may put objects onto the freelist but the processor that
>>   *   froze the slab is the only one that can retrieve the objects from the
>>   *   slab's freelist.
>>   *
>> + *   CPU partial slabs
>> + *
>> + *   The partially empty slabs cached on the CPU partial list are used
>> + *   for performance reasons, which speeds up the allocation process.
>> + *   These slabs are not frozen, but also exempt from list management,
> 
> 					^ are also
> 
> (otherwise somebody could read it as "also are not")
> 

Ah, will fix.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ