From: Vlastimil Babka <vbabka@suse.cz>
To: glittao@gmail.com, cl@linux.com, penberg@kernel.org,
rientjes@google.com, iamjoonsoo.kim@lge.com,
akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, faiyazm@codeaurora.org
Subject: Re: [RFC 3/3] mm/slub: add all_objects implementation in debugfs
Date: Wed, 26 May 2021 16:26:48 +0200 [thread overview]
Message-ID: <48b461c6-0221-5f8c-fb53-08a1f299b048@suse.cz> (raw)
In-Reply-To: <20210521121127.24653-3-glittao@gmail.com>
On 5/21/21 2:11 PM, glittao@gmail.com wrote:
> From: Oliver Glitta <glittao@gmail.com>
>
> Add all_objects implementation to debugfs to print information
> about all objects in slub cache.
An example listing of 1-2 objects would be useful in the changelog.
Also can you describe what are the guarantees (or limitations) of observing
really all objects if the cache is modified by concurrent allocation and free
operations?
...
> +static void *debugfs_all_objects_start(struct seq_file *m, loff_t *ppos)
> +{
> + struct slab_debug_private *priv = m->private;
> + struct kmem_cache *s = priv->inode->i_private;
> + struct page *page;
> +
> + priv->map = kmalloc(BITS_TO_LONGS(MAX_OBJS_PER_PAGE), GFP_KERNEL);
We can use bitmap_alloc/bitmap_free wrappers and allocate according to objects
per page in the actual kmem_cache, not the theoretical maximum, see:
https://lore.kernel.org/linux-mm/20210524233946.20352-2-vbabka@suse.cz/
next prev parent reply other threads:[~2021-05-26 14:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 12:11 [RFC 1/3] mm/slub: aggregate objects in cache by stack trace glittao
2021-05-21 12:11 ` [RFC 2/3] mm/slub: sort objects in cache by frequency of " glittao
2021-05-26 14:06 ` Vlastimil Babka
2021-05-21 12:11 ` [RFC 3/3] mm/slub: add all_objects implementation in debugfs glittao
2021-05-26 14:26 ` Vlastimil Babka [this message]
2021-05-26 14:05 ` [RFC 1/3] mm/slub: aggregate objects in cache by stack trace Vlastimil Babka
2021-06-08 8:45 ` [RFC 4/4] docs: add description of debugfs files for SLUB cache glittao
2021-06-14 0:08 ` David Rientjes
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=48b461c6-0221-5f8c-fb53-08a1f299b048@suse.cz \
--to=vbabka@suse.cz \
--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 \
/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