From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755296Ab2GXOqE (ORCPT ); Tue, 24 Jul 2012 10:46:04 -0400 Received: from smtp108.prem.mail.ac4.yahoo.com ([76.13.13.47]:28817 "HELO smtp108.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754711Ab2GXOqC (ORCPT ); Tue, 24 Jul 2012 10:46:02 -0400 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: hLGHJEkVM1lespT_Z9_MW9TZyiWahEIDTMT9sN8uXkD.4wK fSWJ3ZQ8JuzSZyBBY5qOPU36dLj_sc4Z2f1kx0EdH6qPaNMjEcK04FXoqhHn PRnkDPU62Rtpk9pMwLMKoKbhhppjNthdaOmECKpyKlKqLyn8XmijUjxxgNxZ OTgNFe3ifyixUm5p83A.qpD8r8ICmWR8xO7_BmOzMXl43E9MpCS_Sa_YlOEi vJ6hiZyVPqjPEoM2aoQsIB_VJjD5lMfUuVXOBRgqlCY4EaXyTgdbLq8QN609 _URV6_SLrmKBNrDhvWirItj6kQNQJYTn7QWYVlRddtMOyCaulX7c9D0gDFl0 2ZiQK.R.5mPv.J_2KjpYWPaGpLOAFWGJAM_0rAelEzbjuHR1cxQHcMWNt5ER W X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- Date: Tue, 24 Jul 2012 09:45:57 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@router.home To: Jiang Liu cc: WuJianguo , Tony Luck , Pekka Enberg , Matt Mackall , Mel Gorman , Yinghai Lu , KAMEZAWA Hiroyuki , KOSAKI Motohiro , David Rientjes , Minchan Kim , Keping Chen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jiang Liu Subject: Re: [RFC PATCH v2] SLUB: enhance slub to handle memory nodes without normal memory In-Reply-To: <1343123710-4972-1-git-send-email-jiang.liu@huawei.com> Message-ID: References: <1343123710-4972-1-git-send-email-jiang.liu@huawei.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Jul 2012, Jiang Liu wrote: > > diff --git a/mm/slub.c b/mm/slub.c > index 8c691fa..3976745 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2803,6 +2803,17 @@ static inline int alloc_kmem_cache_cpus(struct kmem_cache *s) > > static struct kmem_cache *kmem_cache_node; > > +static bool node_has_normal_memory(int node) > +{ > + int i; > + > + for (i = ZONE_NORMAL; i >= 0; i--) > + if (populated_zone(&NODE_DATA(node)->node_zones[i])) > + return true; > + > + return false; > +} There is already a N_NORMAL_MEMORY node map that contains a list of node that have *normal* memory usable by slab allocators etc. I think the cleanest solution would be to clear the corresponding node bits for your special movable only zones. Then you wont be needing to modify other subsystems anymore. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx119.postini.com [74.125.245.119]) by kanga.kvack.org (Postfix) with SMTP id 8ECB96B004D for ; Tue, 24 Jul 2012 10:46:02 -0400 (EDT) Date: Tue, 24 Jul 2012 09:45:57 -0500 (CDT) From: Christoph Lameter Subject: Re: [RFC PATCH v2] SLUB: enhance slub to handle memory nodes without normal memory In-Reply-To: <1343123710-4972-1-git-send-email-jiang.liu@huawei.com> Message-ID: References: <1343123710-4972-1-git-send-email-jiang.liu@huawei.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Jiang Liu Cc: WuJianguo , Tony Luck , Pekka Enberg , Matt Mackall , Mel Gorman , Yinghai Lu , KAMEZAWA Hiroyuki , KOSAKI Motohiro , David Rientjes , Minchan Kim , Keping Chen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jiang Liu On Tue, 24 Jul 2012, Jiang Liu wrote: > > diff --git a/mm/slub.c b/mm/slub.c > index 8c691fa..3976745 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2803,6 +2803,17 @@ static inline int alloc_kmem_cache_cpus(struct kmem_cache *s) > > static struct kmem_cache *kmem_cache_node; > > +static bool node_has_normal_memory(int node) > +{ > + int i; > + > + for (i = ZONE_NORMAL; i >= 0; i--) > + if (populated_zone(&NODE_DATA(node)->node_zones[i])) > + return true; > + > + return false; > +} There is already a N_NORMAL_MEMORY node map that contains a list of node that have *normal* memory usable by slab allocators etc. I think the cleanest solution would be to clear the corresponding node bits for your special movable only zones. Then you wont be needing to modify other subsystems anymore. -- 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