From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756079Ab2GXRBA (ORCPT ); Tue, 24 Jul 2012 13:01:00 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:58760 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755953Ab2GXRA5 (ORCPT ); Tue, 24 Jul 2012 13:00:57 -0400 Message-ID: <500ED4B5.4010104@gmail.com> Date: Wed, 25 Jul 2012 01:00:37 +0800 From: Jiang Liu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Christoph Lameter CC: Jiang Liu , 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 Subject: Re: [RFC PATCH v2] SLUB: enhance slub to handle memory nodes without normal memory References: <1343123710-4972-1-git-send-email-jiang.liu@huawei.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/24/2012 10:45 PM, Christoph Lameter wrote: > 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. > Hi Chris, Thanks for your comments! I have thought about the solution mentioned, but seems it doesn't work. We have node masks for both N_NORMAL_MEMORY and N_HIGH_MEMORY to distinguish between normal and highmem on platforms such as x86. But we still don't have such a mechanism to distinguish between "normal" and "movable" memory. So for memory nodes with only movable zones, we still set N_NORMAL_MEMORY for them. One possible solution is to add a node mask for "N_NORMAL_OR_MOVABLE_MEMORY", but haven't tried that yet. Will have a try for that. Thanks! Gerry