All of lore.kernel.org
 help / color / mirror / Atom feed
From: Faiyaz Mohammed <faiyazm@codeaurora.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>, linux-mm <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Greg KH <greg@kroah.com>,
	glittao@gmail.com, vinmenon@codeaurora.org
Subject: Re: [PATCH v10] mm: slub: move sysfs slab alloc/free interfaces to debugfs
Date: Mon, 7 Jun 2021 08:10:06 +0530	[thread overview]
Message-ID: <dd0e3e4e-7eba-039f-7b2b-3fb3131ce2eb@codeaurora.org> (raw)
In-Reply-To: <CAHp75VdM0aziN4zHaf6=z6D0Nb=+GTbjV1pdTpRZ=yxGDZRkhw@mail.gmail.com>



On 6/7/2021 2:01 AM, Andy Shevchenko wrote:
> On Sun, Jun 6, 2021 at 7:16 PM Faiyaz Mohammed <faiyazm@codeaurora.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


  reply	other threads:[~2021-06-07  2:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-06 16:14 [PATCH v10] mm: slub: move sysfs slab alloc/free interfaces to debugfs Faiyaz Mohammed
2021-06-06 18:44 ` kernel test robot
2021-06-06 18:44   ` kernel test robot
2021-06-06 20:31 ` Andy Shevchenko
2021-06-07  2:40   ` Faiyaz Mohammed [this message]
2021-06-07  8:42     ` Andy Shevchenko
2021-06-07 13:54   ` Faiyaz Mohammed
2021-06-07 16:42     ` Andy Shevchenko
2021-06-07  2:01 ` Faiyaz Mohammed
2021-06-07 10:12 ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd0e3e4e-7eba-039f-7b2b-3fb3131ce2eb@codeaurora.org \
    --to=faiyazm@codeaurora.org \
    --cc=akpm@linux-foundation.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=cl@linux.com \
    --cc=glittao@gmail.com \
    --cc=greg@kroah.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    --cc=vinmenon@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.