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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 7 Jun 2021 08:10:06 +0530
From:   Faiyaz Mohammed <faiyazm@...eaurora.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        David Rientjes <rientjes@...gle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        linux-mm <linux-mm@...ck.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Greg KH <greg@...ah.com>, glittao@...il.com,
        vinmenon@...eaurora.org
Subject: Re: [PATCH v10] mm: slub: move sysfs slab alloc/free interfaces to
 debugfs



On 6/7/2021 2:01 AM, Andy Shevchenko wrote:
> On Sun, Jun 6, 2021 at 7:16 PM Faiyaz Mohammed <faiyazm@...eaurora.org> 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
> 
> limitation
> 
>> to "one value per file" rule.
>>
>> To overcome this issues, move the alloc_calls and free_calls implemeation
> 
> implementation
> 
>> to debugfs.
>>
>> Debugfs cache will be created if SLAB_STORE_USER flag is set.
>>
>> Rename the alloc_calls/free_calls to alloc_traces/free_traces,
>> to be inline with what it does.

> ...
> 
>> +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_SLUB_DEBUG)
>> +void debugfs_slab_release(struct kmem_cache *);
>> +#else
> 
>> +static inline void debugfs_slab_release(struct kmem_cache *s)
>> +{
>> +}
> 
> It can be one line.
> 
>> +#endif
> 
> ...
> 
> 
>> +               if (l->sum_time != l->min_time) {
>> +                       seq_printf(seq, " age=%ld/%ld/%ld",
>> +                               l->min_time,
> 
>> +                               (long)div_u64(l->sum_time, l->count),
> 
> Hmm... Why is the cast needed here?
> 
To avoid below warning while preparing build for arm/32 bit,
"format ‘%ld’ expects argument of type ‘long int’, but argument 4 has
type ‘u64 {aka long long unsigned int}"	.
>> +                               l->max_time);
>> +               } else
>> +                       seq_printf(seq, " age=%ld",
>> +                               l->min_time);
> 
> ...
> 
>> +               if (num_online_cpus() > 1 &&
>> +                               !cpumask_empty(to_cpumask(l->cpus)))
> 
> One line?
> 
> ...
> 
>> +static const struct seq_operations slab_debugfs_sops = {
>> +       .start  = slab_debugfs_start,
>> +       .next   = slab_debugfs_next,
>> +       .stop   = slab_debugfs_stop,
> 
>> +       .show   = slab_debugfs_show
> 
> Leave a comma here. It might not be the last one in the future.
> 
>> +};
> 
> + blank line?
> 
>> +static int slab_debug_trace_open(struct inode *inode, struct file *filep)
>> +{
> 
> ...
> 
>> +static const struct file_operations slab_debugfs_fops = {
>> +       .open    = slab_debug_trace_open,
>> +       .read    = seq_read,
>> +       .llseek  = seq_lseek,
>> +       .release = slab_debug_trace_release,
>> +};
>> +
>> +
> 
> One blank line is enough.
> 
> ...
> 
>> +       debugfs_remove_recursive(debugfs_lookup(s->name,
>> +                                       slab_debugfs_root));
> 
> One line?
> 
Will update other comments in next patch.

Thanks and regards,
Mohammed Faiyaz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ