linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Liu <liuj97@gmail.com>
To: Christoph Lameter <cl@linux.com>
Cc: Jiang Liu <jiang.liu@huawei.com>,
	WuJianguo <wujianguo@huawei.com>, Tony Luck <tony.luck@intel.com>,
	Pekka Enberg <penberg@kernel.org>, Matt Mackall <mpm@selenic.com>,
	Mel Gorman <mgorman@suse.de>, Yinghai Lu <yinghai@kernel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	David Rientjes <rientjes@google.com>,
	Minchan Kim <minchan@kernel.org>,
	Keping Chen <chenkeping@huawei.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2] SLUB: enhance slub to handle memory nodes without normal memory
Date: Wed, 25 Jul 2012 01:00:37 +0800	[thread overview]
Message-ID: <500ED4B5.4010104@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1207240931560.29808@router.home>

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

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-07-24 17:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17 16:50 [PATCH] mm/slub: fix a BUG_ON() when offlining a memory node and CONFIG_SLUB_DEBUG is on Jiang Liu
2012-07-17 17:39 ` Christoph Lameter
2012-07-17 17:53   ` Luck, Tony
2012-07-18 15:30     ` Christoph Lameter
2012-07-18 16:52   ` Jiang Liu
2012-07-18 18:53     ` Christoph Lameter
2012-07-24  9:55       ` [RFC PATCH v2] SLUB: enhance slub to handle memory nodes without normal memory Jiang Liu
2012-07-24 14:45         ` Christoph Lameter
2012-07-24 17:00           ` Jiang Liu [this message]
2012-07-25 15:31             ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=500ED4B5.4010104@gmail.com \
    --to=liuj97@gmail.com \
    --cc=chenkeping@huawei.com \
    --cc=cl@linux.com \
    --cc=jiang.liu@huawei.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    --cc=mpm@selenic.com \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=tony.luck@intel.com \
    --cc=wujianguo@huawei.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).