From: akpm@linux-foundation.org Subject: [merged] slub-adjust-memcg-caches-when-creating-cache-alias.patch removed from -mm tree Date: Tue, 08 Apr 2014 14:44:01 -0700 Message-ID: <53446da1.iu/FOGf+Yz8eXD9S%akpm@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:57217 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756800AbaDHVoC (ORCPT ); Tue, 8 Apr 2014 17:44:02 -0400 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: mm-commits@vger.kernel.org, rientjes@google.com, penberg@kernel.org, mhocko@suse.cz, hannes@cmpxchg.org, glommer@gmail.com, vdavydov@parallels.com Subject: [merged] slub-adjust-memcg-caches-when-creating-cache-alias.patch removed from -mm tree To: vdavydov@parallels.com,glommer@gmail.com,hannes@cmpxchg.org,mhocko@suse.cz,penberg@kernel.org,rientjes@google.com,mm-commits@vger.kernel.org From: akpm@linux-foundation.org Date: Tue, 08 Apr 2014 14:44:01 -0700 The patch titled Subject: slub: adjust memcg caches when creating cache alias has been removed from the -mm tree. Its filename was slub-adjust-memcg-caches-when-creating-cache-alias.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Vladimir Davydov Subject: slub: adjust memcg caches when creating cache alias Otherwise, kzalloc() called from a memcg won't clear the whole object. Signed-off-by: Vladimir Davydov Cc: Michal Hocko Cc: Johannes Weiner Cc: David Rientjes Cc: Pekka Enberg Cc: Glauber Costa Signed-off-by: Andrew Morton --- mm/slub.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff -puN mm/slub.c~slub-adjust-memcg-caches-when-creating-cache-alias mm/slub.c --- a/mm/slub.c~slub-adjust-memcg-caches-when-creating-cache-alias +++ a/mm/slub.c @@ -3748,7 +3748,11 @@ __kmem_cache_alias(const char *name, siz s = find_mergeable(size, align, flags, name, ctor); if (s) { + int i; + struct kmem_cache *c; + s->refcount++; + /* * Adjust the object sizes so that we clear * the complete object on kzalloc. @@ -3756,6 +3760,15 @@ __kmem_cache_alias(const char *name, siz s->object_size = max(s->object_size, (int)size); s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *))); + for_each_memcg_cache_index(i) { + c = cache_from_memcg_idx(s, i); + if (!c) + continue; + c->object_size = s->object_size; + c->inuse = max_t(int, c->inuse, + ALIGN(size, sizeof(void *))); + } + if (sysfs_slab_alias(s, name)) { s->refcount--; s = NULL; _ Patches currently in -mm which might be from vdavydov@parallels.com are origin.patch