Re: [PATCH] mm/slab: Increase width of first /proc/slabinfo column

Tobin C. Harding
2019-02-04T05:55:39Z

On Fri, Feb 01, 2019 at 02:03:46PM -0800, Andrew Morton wrote:
> On Thu, 31 Jan 2019 18:43:10 -0800 Matthew Wilcox <willy@infradead.org> wrote:
>
> > On Fri, Feb 01, 2019 at 11:42:42AM +1100, Tobin C. Harding wrote:
> > > Currently when displaying /proc/slabinfo if any cache names are too long
> > > then the output columns are not aligned. We could do something fancy to
> > > get the maximum length of any cache name in the system or we could just
> > > increase the hardcoded width. Currently it is 17 characters. Monitors
> > > are wide these days so lets just increase it to 30 characters.
> >
> > I had a proposal some time ago to turn the slab name from being kmalloced
> > to being an inline 16 bytes (with some fun hacks for cgroups). I think
> > that's a better approach than permitting such long names. For example,
> > ext4_allocation_context could be shortened to ext4_alloc_ctx without
> > losing any expressivity.
> >
>
> There are some back-compatibility concerns here.

I'm don't understand sorry what back-compatibility concerns (please see
sentiment at end of email :)

> And truncating long names might result in duplicates.

So I thought I had a good idea - add a pr_warn() if cache name > 16 and
patch all current intree calls to kmem_cache_create() called as such.

This process very kindly lead me to the fact that this does *not* work
because of the macro KMEM_CACHE (which uses the struct name as the cache
name).

So, back to the drawing board. I'm concerned that this may be a waste
of peoples time, if so please say so and I'll move on to something else.

thanks,
Tobin.