From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754800AbaBDQms (ORCPT ); Tue, 4 Feb 2014 11:42:48 -0500 Received: from cantor2.suse.de ([195.135.220.15]:60016 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753883AbaBDQmp (ORCPT ); Tue, 4 Feb 2014 11:42:45 -0500 Date: Tue, 4 Feb 2014 17:42:43 +0100 From: Michal Hocko To: Johannes Weiner Cc: Andrew Morton , KAMEZAWA Hiroyuki , KOSAKI Motohiro , LKML , linux-mm@kvack.org Subject: Re: [PATCH -v2 5/6] memcg, kmem: clean up memcg parameter handling Message-ID: <20140204164243.GQ4890@dhcp22.suse.cz> References: <1391520540-17436-1-git-send-email-mhocko@suse.cz> <1391520540-17436-6-git-send-email-mhocko@suse.cz> <20140204163210.GQ6963@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140204163210.GQ6963@cmpxchg.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 04-02-14 11:32:10, Johannes Weiner wrote: > On Tue, Feb 04, 2014 at 02:28:59PM +0100, Michal Hocko wrote: > > memcg_kmem_newpage_charge doesn't always set the given memcg parameter. > > lol, I really don't get your patch order... Ok, Ok, I've encountered this mess while double checking #2 and was too lazy to rebasing again. I will move it to the front for the merge. > > Some early escape paths skip setting *memcg while > > __memcg_kmem_newpage_charge down the call chain sets *memcg even if no > > memcg is charged due to other escape paths. > > > > The current code is correct because the memcg is initialized to NULL > > at the highest level in __alloc_pages_nodemask but this all is very > > confusing and error prone. Let's make the semantic clear and move the > > memcg parameter initialization to the highest level of kmem accounting > > (memcg_kmem_newpage_charge). > > > > Signed-off-by: Michal Hocko > > Patch looks good, though. > > Acked-by: Johannes Weiner Thanks! -- Michal Hocko SUSE Labs