linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov@parallels.com>
To: mhocko@suse.cz
Cc: glommer@gmail.com, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	cgroups@vger.kernel.org, devel@openvz.org,
	Johannes Weiner <hannes@cmpxchg.org>,
	Pekka Enberg <penberg@kernel.org>,
	Christoph Lameter <cl@linux.com>
Subject: [PATCH 08/11] slab: do not panic if we fail to create memcg cache
Date: Sat, 21 Dec 2013 19:53:59 +0400	[thread overview]
Message-ID: <df3fd2e16138e4efd5fcb9547b936c54273d3350.1387640542.git.vdavydov@parallels.com> (raw)
In-Reply-To: <cover.1387640541.git.vdavydov@parallels.com>

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>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 mm/slab_common.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/mm/slab_common.c b/mm/slab_common.c
index f34707e..8e40321 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);
-- 
1.7.10.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2013-12-21 15:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-21 15:53 [PATCH 00/11] kmemcg fixes Vladimir Davydov
2013-12-21 15:53 ` [PATCH 01/11] slab: cleanup kmem_cache_create_memcg() error handling Vladimir Davydov
2013-12-21 15:53 ` [PATCH 02/11] memcg, slab: kmem_cache_create_memcg(): fix memleak on fail path Vladimir Davydov
2013-12-21 15:53 ` [PATCH 03/11] memcg, slab: cleanup memcg cache initialization/destruction Vladimir Davydov
2013-12-21 15:53 ` [PATCH 04/11] memcg, slab: fix barrier usage when accessing memcg_caches Vladimir Davydov
2013-12-21 15:53 ` [PATCH 05/11] memcg: fix possible NULL deref while traversing memcg_slab_caches list Vladimir Davydov
2013-12-21 15:53 ` [PATCH 06/11] memcg, slab: fix races in per-memcg cache creation/destruction Vladimir Davydov
2013-12-21 15:53 ` [PATCH 07/11] memcg: get rid of kmem_cache_dup Vladimir Davydov
2013-12-21 15:53 ` Vladimir Davydov [this message]
2013-12-21 15:54 ` [PATCH 09/11] memcg, slab: RCU protect memcg_params for root caches Vladimir Davydov
2013-12-21 15:54 ` [PATCH 10/11] memcg: remove KMEM_ACCOUNTED_ACTIVATED flag Vladimir Davydov
2013-12-21 15:54 ` [PATCH 11/11] memcg: rework memcg_update_kmem_limit synchronization Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df3fd2e16138e4efd5fcb9547b936c54273d3350.1387640542.git.vdavydov@parallels.com \
    --to=vdavydov@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=cl@linux.com \
    --cc=devel@openvz.org \
    --cc=glommer@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=penberg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox