Messages in this thread Patch in this message | | | Date | Mon, 9 Jan 2012 13:19:45 -0800 (PST) | From | David Rientjes <> | Subject | [patch slab/urgent] disallow changing cpu_partial from userspace for debug caches |
| |
For caches with debugging enabled, "slub: Switch per cpu partial page support off for debugging" changes cpu_partial to 0. It shouldn't be tunable from userspace for such caches, otherwise the same accounting issues arise during validation.
This patch disallows tuning /sys/kernel/slab/cache/cpu_partial to be non- zero for caches with debugging enabled.
Signed-off-by: David Rientjes <rientjes@google.com> --- mm/slub.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c --- a/mm/slub.c +++ b/mm/slub.c @@ -4639,6 +4639,8 @@ static ssize_t cpu_partial_store(struct kmem_cache *s, const char *buf, err = strict_strtoul(buf, 10, &objects); if (err) return err; + if (objects && kmem_cache_debug(s)) + return -EINVAL; s->cpu_partial = objects; flush_all(s);
| |