aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Davydov <vdavydov@parallels.com>2014-01-23 15:53:05 -0800
committerMoyster <oysterized@gmail.com>2016-09-28 15:14:28 +0200
commit3c24bbc144755b300e75d802d3cabc882e78c729 (patch)
treecb7c5cbbebd461bc3169e4401ded36a194ee5b6b
parent10a7418a0eb5461c03d4ba6cb4059a8112ba3c6a (diff)
slab: do not panic if we fail to create memcg cache
There is no point in flooding logs with warnings or especially crashing the system if we fail to create a cache for a memcg. In this case we will be accounting the memcg allocation to the root cgroup until we succeed to create its own cache, but it isn't that critical. Signed-off-by: Vladimir Davydov <vdavydov@parallels.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: Glauber Costa <glommer@gmail.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Christoph Lameter <cl@linux.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: W4TCH0UT <ateekujjawal@gmail.com>
-rw-r--r--mm/slab_common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 28e439faa..0bd29f70b 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -222,7 +222,14 @@ out_unlock:
mutex_unlock(&slab_mutex);
put_online_cpus();
- if (err) {
+ /*
+ * There is no point in flooding logs with warnings or especially
+ * crashing the system if we fail to create a cache for a memcg. In
+ * this case we will be accounting the memcg allocation to the root
+ * cgroup until we succeed to create its own cache, but it isn't that
+ * critical.
+ */
+ if (err && !memcg) {
if (flags & SLAB_PANIC)
panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",
name, err);