mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-14 05:52:16 +01:00
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 <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Glauber Costa <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
842e287369
commit
f717eb3abb
1 file changed
+8
-1
+8
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user