Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752395AbbKIUMa (ORCPT ); Mon, 9 Nov 2015 15:12:30 -0500 Received: from mx2.parallels.com ([199.115.105.18]:54035 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751535AbbKIUM2 (ORCPT ); Mon, 9 Nov 2015 15:12:28 -0500 Date: Mon, 9 Nov 2015 23:12:18 +0300 From: Vladimir Davydov To: Tejun Heo CC: Michal Hocko , Andrew Morton , Johannes Weiner , Greg Thelen , , , Subject: Re: [PATCH 0/5] memcg/kmem: switch to white list policy Message-ID: <20151109201218.GP31308@esperanza> References: <20151109140832.GE8916@dhcp22.suse.cz> <20151109182840.GJ31308@esperanza> <20151109185401.GB28507@mtj.duckdns.org> <20151109192747.GN31308@esperanza> <20151109193253.GC28507@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20151109193253.GC28507@mtj.duckdns.org> X-ClientProxiedBy: US-EXCH.sw.swsoft.com (10.255.249.47) To US-EXCH2.sw.swsoft.com (10.255.249.46) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1601 Lines: 46 On Mon, Nov 09, 2015 at 02:32:53PM -0500, Tejun Heo wrote: > On Mon, Nov 09, 2015 at 10:27:47PM +0300, Vladimir Davydov wrote: > > Of course, we could rework slab merging so that kmem_cache_create > > returned a new dummy cache even if it was actually merged. Such a cache > > would point to the real cache, which would be used for allocations. This > > wouldn't limit slab merging, but this would add one more dereference to > > alloc path, which is even worse. > > Hmmm, this could be me not really understanding but why can't we let > all slabs to be merged regardless of SLAB_ACCOUNT flag for root memcg > and point to per-memcg slabs (may be merged among them but most likely Because we won't be able to distinguish kmem_cache_alloc calls that should be accounted from those that shouldn't. The problem is if two caches A = kmem_cache_create(...) and B = kmem_cache_create(...) happen to be merged, A and B will point to the same kmem_cache struct. As a result, there is no way to distinguish kmem_cache_alloc(A) which we want to account from kmem_cache_alloc(B) which we don't. > won't matter) for !root. We're indirecting once anyway, no? If kmem accounting is not used, we aren't indirecting. That's why I don't think we can use dummy kmem_cache struct for merged caches, where we could store __GFP_ACCOUNT flag. Thanks, Vladimir -- 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/