aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab_common.c
diff options
context:
space:
mode:
authorVladimir Davydov <vdavydov@parallels.com>2014-01-23 18:53:05 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:51 -0500
commitf717eb3abb5ea38f60e671dbfdbf512c2c93d22e (patch)
treefe2eab9564f0c35be5bb9c715f12fbdf79b155e4 /mm/slab_common.c
parent842e2873697e023d140a8905a41fcf39d4e546f1 (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>
Diffstat (limited to 'mm/slab_common.c')
-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 f34707eeacc7..8e40321da091 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -233,7 +233,14 @@ out_unlock:
233 mutex_unlock(&slab_mutex); 233 mutex_unlock(&slab_mutex);
234 put_online_cpus(); 234 put_online_cpus();
235 235
236 if (err) { 236 /*
237 * There is no point in flooding logs with warnings or especially
238 * crashing the system if we fail to create a cache for a memcg. In
239 * this case we will be accounting the memcg allocation to the root
240 * cgroup until we succeed to create its own cache, but it isn't that
241 * critical.
242 */
243 if (err && !memcg) {
237 if (flags & SLAB_PANIC) 244 if (flags & SLAB_PANIC)
238 panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n", 245 panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",
239 name, err); 246 name, err);