All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Faiyaz Mohammed <faiyazm@codeaurora.org>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	cl@linux.com, penberg@kernel.org, rientjes@google.com,
	iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
	willy@infradead.org, vinmenon@codeaurora.org,
	Peter Zijlstra <peterz@infradead.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH v2] mm: slub: Convert sys slab alloc_calls, free_calls to bin attribute
Date: Fri, 19 Mar 2021 07:54:36 +0100	[thread overview]
Message-ID: <YFRKrKrtESZwx+Pv@kroah.com> (raw)
In-Reply-To: <3ac1d3e6-6207-96ad-16a1-0f5139d8b2b5@codeaurora.org>

On Fri, Mar 19, 2021 at 10:58:55AM +0530, Faiyaz Mohammed wrote:
> Hi,
> 
> Sorry for late response!
> 
> On 3/2/2021 6:41 PM, Greg Kroah-Hartman wrote:
> > On Tue, Mar 02, 2021 at 01:59:46PM +0100, Vlastimil Babka wrote:
> >> On 2/17/21 7:31 AM, Faiyaz Mohammed wrote:
> >>> Reading the sys slab alloc_calls, free_calls returns the available object
> >>> owners, but the size of this file is limited to PAGE_SIZE
> >>> because of the limitation of sysfs attributes, it is returning the
> >>> partial owner info, which is not sufficient to debug/account the slab
> >>> memory and alloc_calls output is not matching with /proc/slabinfo.
> >>>
> >>> To remove the PAGE_SIZE limitation converted the sys slab
> >>> alloc_calls, free_calls to bin attribut
> >>>
> >>> Signed-off-by: Faiyaz Mohammed <faiyazm@codeaurora.org>
> >>
> >> After discussing this with Greg and PeterZ, sysfs should be one value per file,
> >> and is just not proper API for this kind of info. We should reimplement at least
> >> these clearly debugging "attributes" in debugfs, where they belong, instead of
> >> trying to hack around the limitation in sysfs.
> > 
> > sysfs is _REQUIRED_ to be "one value per file", any kernel code that
> > abuses this needs to be fixed up.
> > 
> > Why are these slab files in sysfs at all anyway?  They all feel like
> > debugging stuff to me, why not move everything to debugfs?  Would make
> > for a lot less code overall.
> > 
> Yes, we can move the /sys/kernel/slab/kmemcache/alloc_calls and
> /sys/kernel/slab/kmemcache/free_calls implementation to debugfs but is
> it okay to move only alloc_calls and free_calls? or we have to move
> whole sysfs interface to debugfs?.

sysfs files should only have "one value" in them.  Anything that
violates that rule, should be moved to debugfs.

thanks,

greg k-h


  reply	other threads:[~2021-03-19  6:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1613543513-11965-1-git-send-email-faiyazm@codeaurora.org>
2021-02-17 11:38 ` [PATCH v2] mm: slub: Convert sys slab alloc_calls, free_calls to bin attribute Faiyaz Mohammed
     [not found] ` <13df1c88-3848-1969-5424-33a927ec033e@suse.cz>
     [not found]   ` <YD45e70b48gyXkIg@kroah.com>
2021-03-19  5:28     ` Faiyaz Mohammed
2021-03-19  6:54       ` Greg Kroah-Hartman [this message]
2021-03-19  9:40       ` 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=YFRKrKrtESZwx+Pv@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=faiyazm@codeaurora.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    --cc=vinmenon@codeaurora.org \
    --cc=willy@infradead.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.