diff options
author | David Rientjes <rientjes@google.com> | 2012-01-09 16:19:45 -0500 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-01-10 14:31:09 -0500 |
commit | 74ee4ef1f901fbb014bdcdc9171d126490ce2b62 (patch) | |
tree | 47f33960c42e4884f56136a61d5dc024895a810e /mm | |
parent | 213eeb9fd9d66c33109e2ace242df214dc3a653d (diff) |
slub: 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.
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slub.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -4649,6 +4649,8 @@ static ssize_t cpu_partial_store(struct kmem_cache *s, const char *buf, | |||
4649 | err = strict_strtoul(buf, 10, &objects); | 4649 | err = strict_strtoul(buf, 10, &objects); |
4650 | if (err) | 4650 | if (err) |
4651 | return err; | 4651 | return err; |
4652 | if (objects && kmem_cache_debug(s)) | ||
4653 | return -EINVAL; | ||
4652 | 4654 | ||
4653 | s->cpu_partial = objects; | 4655 | s->cpu_partial = objects; |
4654 | flush_all(s); | 4656 | flush_all(s); |