diff options
-rw-r--r-- | mm/slab_common.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index 8e40321da091..1ec3c619ba04 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
@@ -233,14 +233,17 @@ out_unlock: | |||
233 | mutex_unlock(&slab_mutex); | 233 | mutex_unlock(&slab_mutex); |
234 | put_online_cpus(); | 234 | put_online_cpus(); |
235 | 235 | ||
236 | /* | 236 | if (err) { |
237 | * There is no point in flooding logs with warnings or especially | 237 | /* |
238 | * crashing the system if we fail to create a cache for a memcg. In | 238 | * There is no point in flooding logs with warnings or |
239 | * this case we will be accounting the memcg allocation to the root | 239 | * especially crashing the system if we fail to create a cache |
240 | * cgroup until we succeed to create its own cache, but it isn't that | 240 | * for a memcg. In this case we will be accounting the memcg |
241 | * critical. | 241 | * allocation to the root cgroup until we succeed to create its |
242 | */ | 242 | * own cache, but it isn't that critical. |
243 | if (err && !memcg) { | 243 | */ |
244 | if (!memcg) | ||
245 | return NULL; | ||
246 | |||
244 | if (flags & SLAB_PANIC) | 247 | if (flags & SLAB_PANIC) |
245 | panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n", | 248 | panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n", |
246 | name, err); | 249 | name, err); |