Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964809AbbKSTMm (ORCPT ); Thu, 19 Nov 2015 14:12:42 -0500 Received: from gum.cmpxchg.org ([85.214.110.215]:44712 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752191AbbKSTMk (ORCPT ); Thu, 19 Nov 2015 14:12:40 -0500 Date: Thu, 19 Nov 2015 14:12:29 -0500 From: Johannes Weiner To: Vladimir Davydov Cc: Andrew Morton , Michal Hocko , Tejun Heo , Greg Thelen , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 6/6] Account certain kmem allocations to memcg Message-ID: <20151119191229.GF3941@cmpxchg.org> References: <3af491b9661b97708ec38e9f9a4f0cccb69ade5c.1447172835.git.vdavydov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3af491b9661b97708ec38e9f9a4f0cccb69ade5c.1447172835.git.vdavydov@virtuozzo.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1692 Lines: 43 On Tue, Nov 10, 2015 at 09:34:07PM +0300, Vladimir Davydov wrote: > This patch marks those kmem allocations that are known to be easily > triggered from userspace as __GFP_ACCOUNT/SLAB_ACCOUNT, which makes them > accounted to memcg. For the list, see below: > > - threadinfo > - task_struct > - task_delay_info > - pid > - cred > - mm_struct > - vm_area_struct and vm_region (nommu) > - anon_vma and anon_vma_chain > - signal_struct > - sighand_struct > - fs_struct > - files_struct > - fdtable and fdtable->full_fds_bits > - dentry and external_name > - inode for all filesystems. This is the most tedious part, because > most filesystems overwrite the alloc_inode method. > > The list is by far not complete, so feel free to add more objects. > Nevertheless, it should be close to "account everything" approach and > keep most workloads within bounds. Malevolent users will be able to > breach the limit, but this was possible even with the former "account > everything" approach (simply because it did not account everything in > fact). > > Signed-off-by: Vladimir Davydov Thanks for doing that work, Vladimir. It looks reasonable to me. We can update the list as we go along and testing reveals more things that need to be considered. As far as malicious users go, I agree that we can not make this bullet proof, and so we shouldn't aim for that. Acked-by: Johannes Weiner -- 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/