From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751592AbbKJSyP (ORCPT ); Tue, 10 Nov 2015 13:54:15 -0500 Received: from mx2.parallels.com ([199.115.105.18]:38060 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750958AbbKJSyN (ORCPT ); Tue, 10 Nov 2015 13:54:13 -0500 Date: Tue, 10 Nov 2015 21:54:01 +0300 From: Vladimir Davydov To: Tejun Heo CC: Andrew Morton , Johannes Weiner , Michal Hocko , Greg Thelen , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , , , Subject: Re: [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Message-ID: <20151110185401.GW31308@esperanza> References: <1ce23e932ea53f47a3376de90b21a9db8293bd6c.1447172835.git.vdavydov@virtuozzo.com> <20151110183808.GB13740@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20151110183808.GB13740@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 On Tue, Nov 10, 2015 at 01:38:08PM -0500, Tejun Heo wrote: > On Tue, Nov 10, 2015 at 09:34:05PM +0300, Vladimir Davydov wrote: > > Currently, if we want to account all objects of a particular kmem cache, > > we have to pass __GFP_ACCOUNT to each kmem_cache_alloc call, which is > > inconvenient. This patch introduces SLAB_ACCOUNT flag which if passed to > > kmem_cache_create will force accounting for every allocation from this > > cache even if __GFP_ACCOUNT is not passed. > > > > This patch does not make any of the existing caches use this flag - it > > will be done later in the series. > > > > Note, a cache with SLAB_ACCOUNT cannot be merged with a cache w/o > > SLAB_ACCOUNT, i.e. using this flag will probably reduce the number of > > merged slabs even if kmem accounting is not used (only compiled in). > > Am I correct in thinking that we should eventually be able to removed > __GFP_ACCOUNT and that only caches explicitly marked with SLAB_ACCOUNT > would need to be handled by kmemcg? Don't think so, because sometimes we want to account kmalloc. Thanks, Vladimir From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Davydov Subject: Re: [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Date: Tue, 10 Nov 2015 21:54:01 +0300 Message-ID: <20151110185401.GW31308@esperanza> References: <1ce23e932ea53f47a3376de90b21a9db8293bd6c.1447172835.git.vdavydov@virtuozzo.com> <20151110183808.GB13740@mtj.duckdns.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <20151110183808.GB13740@mtj.duckdns.org> Sender: owner-linux-mm@kvack.org List-ID: Content-Transfer-Encoding: 7bit To: Tejun Heo Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Greg Thelen , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org On Tue, Nov 10, 2015 at 01:38:08PM -0500, Tejun Heo wrote: > On Tue, Nov 10, 2015 at 09:34:05PM +0300, Vladimir Davydov wrote: > > Currently, if we want to account all objects of a particular kmem cache, > > we have to pass __GFP_ACCOUNT to each kmem_cache_alloc call, which is > > inconvenient. This patch introduces SLAB_ACCOUNT flag which if passed to > > kmem_cache_create will force accounting for every allocation from this > > cache even if __GFP_ACCOUNT is not passed. > > > > This patch does not make any of the existing caches use this flag - it > > will be done later in the series. > > > > Note, a cache with SLAB_ACCOUNT cannot be merged with a cache w/o > > SLAB_ACCOUNT, i.e. using this flag will probably reduce the number of > > merged slabs even if kmem accounting is not used (only compiled in). > > Am I correct in thinking that we should eventually be able to removed > __GFP_ACCOUNT and that only caches explicitly marked with SLAB_ACCOUNT > would need to be handled by kmemcg? Don't think so, because sometimes we want to account kmalloc. Thanks, Vladimir -- 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: email@kvack.org