Re: [PATCH v3] mm: slub: move sysfs slab alloc/free interfaces to debugfs

From: Vlastimil Babka
Date: Wed Apr 07 2021 - 06:30:57 EST


On 4/6/21 7:15 PM, Vlastimil Babka wrote:
> On 4/6/21 2:27 PM, Faiyaz Mohammed wrote:
>> alloc_calls and free_calls implementation in sysfs have two issues,
>> one is PAGE_SIZE limitiation of sysfs and other is it does not adhere
>> to "one value per file" rule.
>>
>> To overcome this issues, move the alloc_calls and free_calls implemeation
>> to debugfs.
>>
>> Signed-off-by: Faiyaz Mohammed <faiyazm@xxxxxxxxxxxxxx>
>
> Good direction, thanks. But I'm afraid we need a bit more:
>
> - I don't see debugfs_remove() (or _recursive) used anywhere. When a cache is
> destroyed, do the dirs/files just linger in debugfs referencing removed
> kmem_cache objects?
> - There's a simple debugfs_create_dir(s->name, ...), for each cache while the
> sysfs variant handles merged caches with symlinks etc. For consistency, the
> hiearchy should look the same in debugfs as it does in sysfs.

Oh and one more suggestion. With full seq_file API (unlike sysfs) we should
really do the data gathering (to struct loc_track?) part just once per file
open, and cache it between individual reads.