Commit c9e16131 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds

slub: disable tracing and failslab for merged slabs

Tracing of mergeable slabs as well as uses of failslab are confusing since
the objects of multiple slab caches will be affected.  Moreover this
creates a situation where a mergeable slab will become unmergeable.

If tracing or failslab testing is desired then it may be best to switch
merging off for starters.
Signed-off-by: default avatarChristoph Lameter <cl@linux.com>
Tested-by: default avatarWANG Chao <chaowang@redhat.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 25c4f304
...@@ -4604,6 +4604,14 @@ static ssize_t trace_show(struct kmem_cache *s, char *buf) ...@@ -4604,6 +4604,14 @@ static ssize_t trace_show(struct kmem_cache *s, char *buf)
static ssize_t trace_store(struct kmem_cache *s, const char *buf, static ssize_t trace_store(struct kmem_cache *s, const char *buf,
size_t length) size_t length)
{ {
/*
* Tracing a merged cache is going to give confusing results
* as well as cause other issues like converting a mergeable
* cache into an umergeable one.
*/
if (s->refcount > 1)
return -EINVAL;
s->flags &= ~SLAB_TRACE; s->flags &= ~SLAB_TRACE;
if (buf[0] == '1') { if (buf[0] == '1') {
s->flags &= ~__CMPXCHG_DOUBLE; s->flags &= ~__CMPXCHG_DOUBLE;
...@@ -4721,6 +4729,9 @@ static ssize_t failslab_show(struct kmem_cache *s, char *buf) ...@@ -4721,6 +4729,9 @@ static ssize_t failslab_show(struct kmem_cache *s, char *buf)
static ssize_t failslab_store(struct kmem_cache *s, const char *buf, static ssize_t failslab_store(struct kmem_cache *s, const char *buf,
size_t length) size_t length)
{ {
if (s->refcount > 1)
return -EINVAL;
s->flags &= ~SLAB_FAILSLAB; s->flags &= ~SLAB_FAILSLAB;
if (buf[0] == '1') if (buf[0] == '1')
s->flags |= SLAB_FAILSLAB; s->flags |= SLAB_FAILSLAB;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment