[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48b461c6-0221-5f8c-fb53-08a1f299b048@suse.cz>
Date: Wed, 26 May 2021 16:26:48 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: glittao@...il.com, cl@...ux.com, penberg@...nel.org,
rientjes@...gle.com, iamjoonsoo.kim@....com,
akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
faiyazm@...eaurora.org
Subject: Re: [RFC 3/3] mm/slub: add all_objects implementation in debugfs
On 5/21/21 2:11 PM, glittao@...il.com wrote:
> From: Oliver Glitta <glittao@...il.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/
Powered by blists - more mailing lists