From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx204.postini.com [74.125.245.204]) by kanga.kvack.org (Postfix) with SMTP id CA0206B0073 for ; Fri, 28 Sep 2012 09:28:57 -0400 (EDT) Date: Fri, 28 Sep 2012 14:28:39 +0100 From: Mel Gorman Subject: Re: [PATCH v3 07/13] mm: Allocate kernel pages to the right memcg Message-ID: <20120928132839.GG29125@suse.de> References: <1347977050-29476-1-git-send-email-glommer@parallels.com> <1347977050-29476-8-git-send-email-glommer@parallels.com> <20120927135053.GF3429@suse.de> <50657153.8010101@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <50657153.8010101@parallels.com> Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, kamezawa.hiroyu@jp.fujitsu.com, devel@openvz.org, Tejun Heo , linux-mm@kvack.org, Suleiman Souhlal , Frederic Weisbecker , David Rientjes , Christoph Lameter , Pekka Enberg , Michal Hocko , Johannes Weiner On Fri, Sep 28, 2012 at 01:43:47PM +0400, Glauber Costa wrote: > On 09/27/2012 05:50 PM, Mel Gorman wrote: > >> +void __free_accounted_pages(struct page *page, unsigned int order) > >> > +{ > >> > + memcg_kmem_uncharge_page(page, order); > >> > + __free_pages(page, order); > >> > +} > >> > + > >> > +void free_accounted_pages(unsigned long addr, unsigned int order) > >> > +{ > >> > + if (addr != 0) { > >> > + VM_BUG_ON(!virt_addr_valid((void *)addr)); > > This is probably overkill. If it's invalid, the next line is likely to > > blow up anyway. It's no biggie. > > > > So this is here because it is in free_pages() as well. If it blows, at > least we know precisely why (if debugging), and VM_BUG_ON() is only > compiled in when CONFIG_DEBUG_VM. > Ah, I see. > But I'm fine with either. > Should it stay or should it go ? > It can stay. It makes sense that it look similar to free_pages() and as you say, it makes debugging marginally easier. -- Mel Gorman SUSE Labs -- 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