提交 f717eb3a 编写于 作者: V Vladimir Davydov 提交者: Linus Torvalds

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: NVladimir 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 842e2873
......@@ -233,7 +233,14 @@ kmem_cache_create_memcg(struct mem_cgroup *memcg, const char *name, size_t size,
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册