diff options
author | Vladimir Davydov <vdavydov@parallels.com> | 2014-01-15 16:55:11 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-01-15 16:55:11 +1100 |
commit | b33a1403815701b2aaf688fa59ed9271fb33d48f (patch) | |
tree | a0746bee7e40cd5f80bf24763d24050b83380a89 /mm | |
parent | 8e2f560e6d9a41b0b53e64c23fa04082c07fd0b9 (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>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab_common.c | 9 |
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: 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); |