linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Faiyaz Mohammed <faiyazm@codeaurora.org>
Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com,
	iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
	vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	glittao@gmail.com, vinmenon@codeaurora.org
Subject: Re: [PATCH v5] mm: slub: move sysfs slab alloc/free interfaces to debugfs
Date: Tue, 18 May 2021 15:33:41 +0200	[thread overview]
Message-ID: <YKPCNT+yiBfkvnbP@kroah.com> (raw)
In-Reply-To: <6d91e7cb-514f-8816-76b1-a70f6891a47a@codeaurora.org>

On Tue, May 18, 2021 at 06:24:48PM +0530, Faiyaz Mohammed wrote:
> 
> 
> On 5/7/2021 5:18 PM, Greg KH wrote:
> > On Thu, May 06, 2021 at 03:52:03PM +0530, 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.
> >>
> >> Rename the alloc_calls/free_calls to alloc_traces/free_traces,
> >> to be inline with what it does.
> >>
> >> Signed-off-by: Faiyaz Mohammed <faiyazm@codeaurora.org>
> >> ---
> >>  include/linux/slub_def.h |  10 ++
> >>  mm/slab_common.c         |   9 ++
> >>  mm/slub.c                | 362 ++++++++++++++++++++++++++++++++++++-----------
> >>  3 files changed, 299 insertions(+), 82 deletions(-)
> >>
> >> diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
> >> index dcde82a..f8c268d 100644
> >> --- a/include/linux/slub_def.h
> >> +++ b/include/linux/slub_def.h
> >> @@ -110,6 +110,9 @@ struct kmem_cache {
> >>  #ifdef CONFIG_SYSFS
> >>  	struct kobject kobj;	/* For sysfs */
> >>  #endif
> >> +#ifdef CONFIG_SLUB_DEBUG
> >> +	struct dentry *slab_cache_dentry;
> >> +#endif
> >>  #ifdef CONFIG_SLAB_FREELIST_HARDENED
> >>  	unsigned long random;
> >>  #endif
> >> @@ -159,6 +162,13 @@ static inline void sysfs_slab_release(struct kmem_cache *s)
> >>  }
> >>  #endif
> >>  
> >> +#ifdef CONFIG_DEBUG_FS
> >> +void debugfs_slab_release(struct kmem_cache *);
> >> +#else
> >> +static inline void debugfs_slab_release(struct kmem_cache *s)
> >> +{
> >> +}
> >> +#endif
> >>  void object_err(struct kmem_cache *s, struct page *page,
> >>  		u8 *object, char *reason);
> >>  
> >> diff --git a/mm/slab_common.c b/mm/slab_common.c
> >> index f8833d3..f3afe6b 100644
> >> --- a/mm/slab_common.c
> >> +++ b/mm/slab_common.c
> >> @@ -445,6 +445,9 @@ static void slab_caches_to_rcu_destroy_workfn(struct work_struct *work)
> >>  #else
> >>  		slab_kmem_cache_release(s);
> >>  #endif
> >> +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_SLUB)
> >> +		debugfs_slab_release(s);
> >> +#endif
> > 
> > If you write your .h files correctly, no need for #ifdef in a .c file.
> > 
> > Please fix up.
> > 
> fixed in new patch and used the single #ifded because
> debugfs_slab_release declaration is there in slub_def.h and slab_common
> is used for both slab and slub.
> Like SLAB_SUPPORTS_SYSFS, SLAB_SUPPORT_DEBUGFS will be not defined if
> slab config is used.

No, you should have have any #ifdef at all, as I point out in that
review.

thanks,

greg k-h


      reply	other threads:[~2021-05-18 13:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 10:22 [PATCH v5] mm: slub: move sysfs slab alloc/free interfaces to debugfs Faiyaz Mohammed
2021-05-06 14:29 ` kernel test robot
2021-05-06 14:32 ` kernel test robot
2021-05-07  5:21 ` Dan Carpenter
2021-05-18 12:49   ` Faiyaz Mohammed
2021-05-07 11:48 ` Greg KH
2021-05-18 12:54   ` Faiyaz Mohammed
2021-05-18 13:33     ` Greg KH [this message]

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=YKPCNT+yiBfkvnbP@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=faiyazm@codeaurora.org \
    --cc=glittao@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).