Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754858Ab2FYSHz (ORCPT ); Mon, 25 Jun 2012 14:07:55 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:51594 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752113Ab2FYSHx (ORCPT ); Mon, 25 Jun 2012 14:07:53 -0400 Date: Mon, 25 Jun 2012 11:07:47 -0700 From: Tejun Heo To: Glauber Costa Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org, Frederic Weisbecker , David Rientjes , Pekka Enberg , Michal Hocko , Johannes Weiner , Christoph Lameter , devel@openvz.org, kamezawa.hiroyu@jp.fujitsu.com, Pekka Enberg , Suleiman Souhlal Subject: Re: [PATCH 07/11] mm: Allocate kernel pages to the right memcg Message-ID: <20120625180747.GE3869@google.com> References: <1340633728-12785-1-git-send-email-glommer@parallels.com> <1340633728-12785-8-git-send-email-glommer@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1340633728-12785-8-git-send-email-glommer@parallels.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1019 Lines: 22 On Mon, Jun 25, 2012 at 06:15:24PM +0400, Glauber Costa wrote: > When a process tries to allocate a page with the __GFP_KMEMCG flag, > the page allocator will call the corresponding memcg functions to > validate the allocation. Tasks in the root memcg can always proceed. > > To avoid adding markers to the page - and a kmem flag that would > necessarily follow, as much as doing page_cgroup lookups for no > reason, whoever is marking its allocations with __GFP_KMEMCG flag > is responsible for telling the page allocator that this is such an > allocation at free_pages() time. This is done by the invocation of > __free_accounted_pages() and free_accounted_pages(). Shouldn't we be documenting that in the code somewhere, preferably in the function comments? -- tejun -- 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/