From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755977Ab2ISOHi (ORCPT ); Wed, 19 Sep 2012 10:07:38 -0400 Received: from a194-183.smtp-out.amazonses.com ([199.255.194.183]:2331 "EHLO a194-183.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754492Ab2ISOHf (ORCPT ); Wed, 19 Sep 2012 10:07:35 -0400 Date: Wed, 19 Sep 2012 14:07:33 +0000 From: Christoph Lameter X-X-Sender: cl@gentwo.org 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 , Mel Gorman , David Rientjes , Pekka Enberg , Michal Hocko , Johannes Weiner , Rik van Riel , Mel Gorman Subject: Re: [PATCH v3 05/13] Add a __GFP_KMEMCG flag In-Reply-To: <505976B5.6090801@parallels.com> Message-ID: <00000139dedaeb71-1199f5a3-c122-460e-a1d8-74174a9d96db-000000@email.amazonses.com> References: <1347977050-29476-1-git-send-email-glommer@parallels.com> <1347977050-29476-6-git-send-email-glommer@parallels.com> <00000139d9ea69c6-109249c2-5176-4a1e-b000-4c076d05844d-000000@email.amazonses.com> <505976B5.6090801@parallels.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SES-Outgoing: 199.255.194.183 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Sep 2012, Glauber Costa wrote: > On 09/18/2012 07:06 PM, Christoph Lameter wrote: > > On Tue, 18 Sep 2012, Glauber Costa wrote: > > > >> +++ b/include/linux/gfp.h > >> @@ -35,6 +35,11 @@ struct vm_area_struct; > >> #else > >> #define ___GFP_NOTRACK 0 > >> #endif > >> +#ifdef CONFIG_MEMCG_KMEM > >> +#define ___GFP_KMEMCG 0x400000u > >> +#else > >> +#define ___GFP_KMEMCG 0 > >> +#endif > > > > Could you leave __GFP_MEMCG a simple definition and then define GFP_MEMCG > > to be zer0 if !MEMCG_KMEM? I think that would be cleaner and the > > __GFP_KMEMCHECK another case that would be good to fix up. > > > > > > > I can, but what does this buy us? All the numeric values should be defined with __ unconditionally so that they can be used in future context. Note the comment above the __GFP_XX which says "Do not use this directly". > Also, in any case, this can be done incrementally, and for the other > flag as well, as you describe. There is only one other flag that does not follow the scheme. I'd appreciate it if you could submit a patch to fix up the __GFP_NOTRACK conditional there. There is no need to do this incrementally. Do it the right way immediately. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx189.postini.com [74.125.245.189]) by kanga.kvack.org (Postfix) with SMTP id C64EC6B005A for ; Wed, 19 Sep 2012 10:07:34 -0400 (EDT) Date: Wed, 19 Sep 2012 14:07:33 +0000 From: Christoph Lameter Subject: Re: [PATCH v3 05/13] Add a __GFP_KMEMCG flag In-Reply-To: <505976B5.6090801@parallels.com> Message-ID: <00000139dedaeb71-1199f5a3-c122-460e-a1d8-74174a9d96db-000000@email.amazonses.com> References: <1347977050-29476-1-git-send-email-glommer@parallels.com> <1347977050-29476-6-git-send-email-glommer@parallels.com> <00000139d9ea69c6-109249c2-5176-4a1e-b000-4c076d05844d-000000@email.amazonses.com> <505976B5.6090801@parallels.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 , Mel Gorman , David Rientjes , Pekka Enberg , Michal Hocko , Johannes Weiner , Rik van Riel , Mel Gorman On Wed, 19 Sep 2012, Glauber Costa wrote: > On 09/18/2012 07:06 PM, Christoph Lameter wrote: > > On Tue, 18 Sep 2012, Glauber Costa wrote: > > > >> +++ b/include/linux/gfp.h > >> @@ -35,6 +35,11 @@ struct vm_area_struct; > >> #else > >> #define ___GFP_NOTRACK 0 > >> #endif > >> +#ifdef CONFIG_MEMCG_KMEM > >> +#define ___GFP_KMEMCG 0x400000u > >> +#else > >> +#define ___GFP_KMEMCG 0 > >> +#endif > > > > Could you leave __GFP_MEMCG a simple definition and then define GFP_MEMCG > > to be zer0 if !MEMCG_KMEM? I think that would be cleaner and the > > __GFP_KMEMCHECK another case that would be good to fix up. > > > > > > > I can, but what does this buy us? All the numeric values should be defined with __ unconditionally so that they can be used in future context. Note the comment above the __GFP_XX which says "Do not use this directly". > Also, in any case, this can be done incrementally, and for the other > flag as well, as you describe. There is only one other flag that does not follow the scheme. I'd appreciate it if you could submit a patch to fix up the __GFP_NOTRACK conditional there. There is no need to do this incrementally. Do it the right way immediately. -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: Re: [PATCH v3 05/13] Add a __GFP_KMEMCG flag Date: Wed, 19 Sep 2012 14:07:33 +0000 Message-ID: <00000139dedaeb71-1199f5a3-c122-460e-a1d8-74174a9d96db-000000@email.amazonses.com> References: <1347977050-29476-1-git-send-email-glommer@parallels.com> <1347977050-29476-6-git-send-email-glommer@parallels.com> <00000139d9ea69c6-109249c2-5176-4a1e-b000-4c076d05844d-000000@email.amazonses.com> <505976B5.6090801@parallels.com> Mime-Version: 1.0 Return-path: In-Reply-To: <505976B5.6090801-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: TEXT/PLAIN; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Glauber Costa Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org, devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, Tejun Heo , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Suleiman Souhlal , Frederic Weisbecker , Mel Gorman , David Rientjes , Pekka Enberg , Michal Hocko , Johannes Weiner , Rik van Riel , Mel Gorman On Wed, 19 Sep 2012, Glauber Costa wrote: > On 09/18/2012 07:06 PM, Christoph Lameter wrote: > > On Tue, 18 Sep 2012, Glauber Costa wrote: > > > >> +++ b/include/linux/gfp.h > >> @@ -35,6 +35,11 @@ struct vm_area_struct; > >> #else > >> #define ___GFP_NOTRACK 0 > >> #endif > >> +#ifdef CONFIG_MEMCG_KMEM > >> +#define ___GFP_KMEMCG 0x400000u > >> +#else > >> +#define ___GFP_KMEMCG 0 > >> +#endif > > > > Could you leave __GFP_MEMCG a simple definition and then define GFP_MEMCG > > to be zer0 if !MEMCG_KMEM? I think that would be cleaner and the > > __GFP_KMEMCHECK another case that would be good to fix up. > > > > > > > I can, but what does this buy us? All the numeric values should be defined with __ unconditionally so that they can be used in future context. Note the comment above the __GFP_XX which says "Do not use this directly". > Also, in any case, this can be done incrementally, and for the other > flag as well, as you describe. There is only one other flag that does not follow the scheme. I'd appreciate it if you could submit a patch to fix up the __GFP_NOTRACK conditional there. There is no need to do this incrementally. Do it the right way immediately.