Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1389242

Re: [PATCH v4] mm: SLAB freelist randomization

From Christoph Lameter <cl@linux.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4] mm: SLAB freelist randomization
Date 2016-04-27 17:40 +0200
Message-ID <rszJg-3tA-31@gated-at.bofh.it> (permalink)
References <rse26-2io-13@gated-at.bofh.it> <rskqT-7Qj-49@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 26 Apr 2016, Andrew Morton wrote:

> : CONFIG_FREELIST_RANDOM bugs me a bit - "freelist" is so vague.
> : CONFIG_SLAB_FREELIST_RANDOM would be better.  I mean, what Kconfig
> : identifier could be used for implementing randomisation in
> : slub/slob/etc once CONFIG_FREELIST_RANDOM is used up?
>
> but this pearl appeared to pass unnoticed.

Ok. lets add SLAB here and then use this option for the other allocators
as well.

> > +	/* If it fails, we will just use the global lists */
> > +	cachep->random_seq = kcalloc(count, sizeof(freelist_idx_t), GFP_KERNEL);
> > +	if (!cachep->random_seq)
> > +		return -ENOMEM;
>
> OK, no BUG.  If this happens, kmem_cache_init_late() will go BUG
> instead ;)
>
> Questions for slab maintainers:
>
> What's going on with the gfp_flags in there?  kmem_cache_init_late()
> passes GFP_NOWAIT into enable_cpucache().
>
> a) why the heck does it do that?  It's __init code!

enable_cpucache() was called when a slab cache was reconfigured by writing to /proc/slabinfo.
That was changed awhile back when the memcg changes were made ot slab. So
now its ok to be made init code.

> Finally, all callers of enable_cpucache() (and hence of
> cache_random_seq_create()) are __init, so we're unnecessarily bloating
> up vmlinux.  Could someone please take a look at this as a separate
> thing?

Hmmm. Well if that is the case then lots of stuff could be straightened
out. Joonsoo?

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v4] mm: SLAB freelist randomization Thomas Garnier <thgarnie@google.com> - 2016-04-26 18:30 +0200
  Re: [PATCH v4] mm: SLAB freelist randomization Andrew Morton <akpm@linux-foundation.org> - 2016-04-27 01:20 +0200
    Re: [PATCH v4] mm: SLAB freelist randomization Thomas Garnier <thgarnie@google.com> - 2016-04-27 01:50 +0200
      Re: [PATCH v4] mm: SLAB freelist randomization Christoph Lameter <cl@linux.com> - 2016-04-27 17:50 +0200
    Re: [PATCH v4] mm: SLAB freelist randomization Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-04-27 03:00 +0200
    Re: [PATCH v4] mm: SLAB freelist randomization Christoph Lameter <cl@linux.com> - 2016-04-27 17:40 +0200

csiph-web