Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753962AbaKCVBh (ORCPT ); Mon, 3 Nov 2014 16:01:37 -0500 Received: from mx2.parallels.com ([199.115.105.18]:39093 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753959AbaKCVAP (ORCPT ); Mon, 3 Nov 2014 16:00:15 -0500 From: Vladimir Davydov To: Andrew Morton CC: Johannes Weiner , Michal Hocko , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , , Subject: [PATCH -mm 5/8] memcg: free kmem cache id on css offline Date: Mon, 3 Nov 2014 23:59:43 +0300 Message-ID: <6618a87bfb6bbad5c8a72f2d1fafedcfb6e93f6e.1415046910.git.vdavydov@parallels.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [81.5.99.36] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This will allow new kmem active cgroups to reuse the id and therefore the caches used by the dead memory cgroup. Signed-off-by: Vladimir Davydov --- mm/memcontrol.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 923fe4c29e92..755604079d8e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -605,14 +605,10 @@ int memcg_limited_groups_array_size; struct static_key memcg_kmem_enabled_key; EXPORT_SYMBOL(memcg_kmem_enabled_key); -static void memcg_free_cache_id(int id); - static void disarm_kmem_keys(struct mem_cgroup *memcg) { - if (memcg_kmem_is_active(memcg)) { + if (memcg_kmem_is_active(memcg)) static_key_slow_dec(&memcg_kmem_enabled_key); - memcg_free_cache_id(memcg->kmemcg_id); - } /* * This check can't live in kmem destruction function, * since the charges will outlive the cgroup @@ -4730,6 +4726,11 @@ static void mem_cgroup_css_offline(struct cgroup_subsys_state *css) spin_unlock(&memcg->event_list_lock); vmpressure_cleanup(&memcg->vmpressure); + +#ifdef CONFIG_MEMCG_KMEM + if (memcg_kmem_is_active(memcg)) + memcg_free_cache_id(memcg_cache_id(memcg)); +#endif } static void mem_cgroup_css_free(struct cgroup_subsys_state *css) -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/