linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Christopher Lameter <cl@linux.com>
Cc: ? ? <mordorw@hotmail.com>, "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH] slab: fix /proc/slabinfo alignment
Date: Tue, 20 Feb 2018 10:36:59 -0800	[thread overview]
Message-ID: <20180220183659.GA12573@bombadil.infradead.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1802201022540.29313@nuc-kabylake>

On Tue, Feb 20, 2018 at 10:23:41AM -0600, Christopher Lameter wrote:
> On Tue, 20 Feb 2018, Matthew Wilcox wrote:
> 
> > I don't think it's fixable; there's just too much information per slab.
> > Anyway, I preferred the solution you & I were working on to limit the
> > length of names to 16 bytes, except for the cgroup slabs.
> 
> So what do we do with the cgroup slab names? have a slabinfo per cgroup?

What I had in mind ...

struct kmem_cache_attr {
        const char name[16];
        unsigned int size;
        unsigned int align;
        unsigned int useroffset;
        unsigned int usersize;
        slab_flags_t flags;
        kmem_cache_ctor ctor;
}

struct kmem_cache {
        const struct kmem_cache_attr *a;
        const char *name;
	...
};

In kmem_cache_create_usercopy:

	s->name = a->name;

In memcg_create_kmem_cache:

	s->name = kasprintf(GFP_KERNEL, "%s(%llu:%s)", a->name,
				css->serial_nr, memcg_name_buf);

In slab_kmem_cache_release:

	if (s->name != s->a->name)
		kfree_const(s->name);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2018-02-20 18:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20  2:29 [PATCH] slab: fix /proc/slabinfo alignment ? ?
2018-02-20  8:49 ` Michal Hocko
2018-02-20 14:56 ` Christopher Lameter
2018-02-20 15:04   ` Matthew Wilcox
2018-02-20 16:05     ` Christopher Lameter
2018-02-20 16:11       ` Matthew Wilcox
2018-02-20 16:23         ` Christopher Lameter
2018-02-20 18:36           ` Matthew Wilcox [this message]
2018-02-20 18:43             ` Christopher Lameter
2018-02-20 19:19               ` Matthew Wilcox

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=20180220183659.GA12573@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=cl@linux.com \
    --cc=linux-mm@kvack.org \
    --cc=mordorw@hotmail.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;
as well as URLs for NNTP newsgroup(s).