diff options
author | Christoph Lameter <cl@linux.com> | 2014-10-09 18:26:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 22:25:51 -0400 |
commit | c9e16131d6e39bddd183f0b9d787ec0a62bf0eeb (patch) | |
tree | d0a92993d7077e883459e49c3971bde51116bcb7 /mm/slub.c | |
parent | 25c4f304be8cd6831105d3a2876028e4ecd254a1 (diff) |
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: Christoph Lameter <cl@linux.com>
Tested-by: WANG 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -4604,6 +4604,14 @@ static ssize_t trace_show(struct kmem_cache *s, char *buf) | |||
4604 | static ssize_t trace_store(struct kmem_cache *s, const char *buf, | 4604 | static ssize_t trace_store(struct kmem_cache *s, const char *buf, |
4605 | size_t length) | 4605 | size_t length) |
4606 | { | 4606 | { |
4607 | /* | ||
4608 | * Tracing a merged cache is going to give confusing results | ||
4609 | * as well as cause other issues like converting a mergeable | ||
4610 | * cache into an umergeable one. | ||
4611 | */ | ||
4612 | if (s->refcount > 1) | ||
4613 | return -EINVAL; | ||
4614 | |||
4607 | s->flags &= ~SLAB_TRACE; | 4615 | s->flags &= ~SLAB_TRACE; |
4608 | if (buf[0] == '1') { | 4616 | if (buf[0] == '1') { |
4609 | s->flags &= ~__CMPXCHG_DOUBLE; | 4617 | s->flags &= ~__CMPXCHG_DOUBLE; |
@@ -4721,6 +4729,9 @@ static ssize_t failslab_show(struct kmem_cache *s, char *buf) | |||
4721 | static ssize_t failslab_store(struct kmem_cache *s, const char *buf, | 4729 | static ssize_t failslab_store(struct kmem_cache *s, const char *buf, |
4722 | size_t length) | 4730 | size_t length) |
4723 | { | 4731 | { |
4732 | if (s->refcount > 1) | ||
4733 | return -EINVAL; | ||
4734 | |||
4724 | s->flags &= ~SLAB_FAILSLAB; | 4735 | s->flags &= ~SLAB_FAILSLAB; |
4725 | if (buf[0] == '1') | 4736 | if (buf[0] == '1') |
4726 | s->flags |= SLAB_FAILSLAB; | 4737 | s->flags |= SLAB_FAILSLAB; |