All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Congyang <wency@cn.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>,
	Mel Gorman <mgorman@suse.de>, LKML <linux-kernel@vger.kernel.org>,
	x86 maintainers <x86@kernel.org>,
	Jiang Liu <jiang.liu@huawei.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Yinghai Lu <yinghai@kernel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christoph Lameter <cl@linux.com>, Hillf Danton <dhillf@gmail.com>
Subject: Re: [V5 PATCH 05/26] node_states: introduce N_MEMORY
Date: Wed, 31 Oct 2012 15:03:36 +0800	[thread overview]
Message-ID: <5090CD48.30604@cn.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1210291342090.18552@chino.kir.corp.google.com>

At 10/30/2012 04:46 AM, David Rientjes Wrote:
> On Mon, 29 Oct 2012, Lai Jiangshan wrote:
> 
>> We have N_NORMAL_MEMORY for standing for the nodes that have normal memory with
>> zone_type <= ZONE_NORMAL.
>>
>> And we have N_HIGH_MEMORY for standing for the nodes that have normal or high
>> memory.
>>
> 
> (In other words, all memory.)
> 
>> But we don't have any word to stand for the nodes that have *any* memory.
>>
> 
> It's N_HIGH_MEMORY, or at least it's supposed to be.  Is there a problem 
> where the bit isn't getting set for a node with memory?
> 
>> A)	But this reusing is bad for *readability*. Because the name
>> 	N_HIGH_MEMORY just stands for high or normal:
>>
>> A.example 1)
>> 	mem_cgroup_nr_lru_pages():
>> 		for_each_node_state(nid, N_HIGH_MEMORY)
>>
>> 	The user will be confused(why this function just counts for high or
>> 	normal memory node? does it counts for ZONE_MOVABLE's lru pages?)
>> 	until someone else tell them N_HIGH_MEMORY is reused to stand for
>> 	nodes that have any memory.
>>
>> A.cont) If we introduce N_MEMORY, we can reduce this confusing
>> 	AND make the code more clearly:
>>
>> A.example 2) mm/page_cgroup.c use N_HIGH_MEMORY twice:
>>
>> 	One is in page_cgroup_init(void):
>> 		for_each_node_state(nid, N_HIGH_MEMORY) {
>>
>> 	It means if the node have memory, we will allocate page_cgroup map for
>> 	the node. We should use N_MEMORY instead here to gaim more clearly.
>>
>> 	The second using is in alloc_page_cgroup():
>> 		if (node_state(nid, N_HIGH_MEMORY))
>> 			addr = vzalloc_node(size, nid);
>>
>> 	It means if the node has high or normal memory that can be allocated
>> 	from kernel. We should keep N_HIGH_MEMORY here, and it will be better
>> 	if the "any memory" semantic of N_HIGH_MEMORY is removed.
>>
>> B)	This reusing is out-dated if we introduce MOVABLE-dedicated node.
>> 	The MOVABLE-dedicated node should not appear in
>> 	node_stats[N_HIGH_MEMORY] nor node_stats[N_NORMAL_MEMORY],
>> 	because MOVABLE-dedicated node has no high or normal memory.
>>
>> 	In x86_64, N_HIGH_MEMORY=N_NORMAL_MEMORY, if a MOVABLE-dedicated node
>> 	is in node_stats[N_HIGH_MEMORY], it is also means it is in
>> 	node_stats[N_NORMAL_MEMORY], it causes SLUB wrong.
>>
>> 	The slub uses
>> 		for_each_node_state(nid, N_NORMAL_MEMORY)
>> 	and creates kmem_cache_node for MOVABLE-dedicated node and cause problem.
>>
>> In one word, we need a N_MEMORY. We just intrude it as an alias to
>> N_HIGH_MEMORY and fix all im-proper usages of N_HIGH_MEMORY in late patches.
>>
> 
> If this is really that problematic (and it appears it's not given that 
> there are many use cases of it and people tend to get it right), then why 
> not simply rename N_HIGH_MEMORY instead of introducing yet another 
> nodemask to the equation?

The reason is that we need a node which only contains movable memory. This
feature is very important for node hotplug. So we will add a new nodemask
for movable memory. N_MEMORY contains movable memory but N_HIGH_MEMORY
doesn't contain it.

Thanks
Wen Congyang

> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


  reply	other threads:[~2012-10-31  7:04 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29 15:07 [V5 PATCH 00/26] mm, memory-hotplug: dynamic configure movable memory and introduce movable node Lai Jiangshan
2012-10-29 15:07 ` [V5 PATCH 01/26] mm, memory-hotplug: dynamic configure movable memory and portion memory Lai Jiangshan
2012-10-29 15:20 ` [V5 PATCH 02/26] memory_hotplug: handle empty zone when online_movable/online_kernel Lai Jiangshan
2012-10-29 15:20   ` Lai Jiangshan
2012-10-29 15:20 ` [V5 PATCH 03/26] memory_hotplug: ensure every online node has NORMAL memory Lai Jiangshan
2012-10-29 15:20   ` Lai Jiangshan
2012-10-29 15:20 ` [V5 PATCH 04/26] node: cleanup node_state_attr Lai Jiangshan
2012-10-29 15:20 ` [V5 PATCH 05/26] node_states: introduce N_MEMORY Lai Jiangshan
2012-10-29 20:46   ` David Rientjes
2012-10-31  7:03     ` Wen Congyang [this message]
2012-10-29 15:20 ` [V5 PATCH 06/26] cpuset: use N_MEMORY instead N_HIGH_MEMORY Lai Jiangshan
2012-10-29 15:20 ` [V5 PATCH 07/26] procfs: " Lai Jiangshan
     [not found] ` <1351523301-20048-1-git-send-email-laijs-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-10-29 15:20   ` [V5 PATCH 08/26] memcontrol: " Lai Jiangshan
2012-10-29 15:20     ` Lai Jiangshan
2012-10-29 15:20     ` Lai Jiangshan
     [not found]     ` <1351524078-20363-7-git-send-email-laijs-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-10-29 16:22       ` Michal Hocko
2012-10-29 16:22       ` Michal Hocko
2012-10-29 16:22         ` Michal Hocko
2012-10-29 16:22         ` Michal Hocko
     [not found]         ` <20121029162212.GE20757-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2012-10-29 20:40           ` David Rientjes
2012-10-29 20:40         ` David Rientjes
2012-10-29 20:40           ` David Rientjes
     [not found]           ` <alpine.DEB.2.00.1210291340100.18552-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2012-10-29 20:58             ` Michal Hocko
2012-10-29 20:58               ` Michal Hocko
2012-10-29 20:58               ` Michal Hocko
     [not found]               ` <20121029205806.GB21640-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2012-10-29 21:08                 ` David Rientjes
2012-10-29 21:08                   ` David Rientjes
2012-10-29 21:08                   ` David Rientjes
     [not found]                   ` <alpine.DEB.2.00.1210291405100.18552-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2012-10-29 21:34                     ` Michal Hocko
2012-10-29 21:34                     ` Michal Hocko
2012-10-29 21:34                       ` Michal Hocko
2012-10-29 21:34                       ` Michal Hocko
2012-10-31 13:18       ` Michal Hocko
2012-10-31 13:18       ` Michal Hocko
2012-10-31 13:18         ` Michal Hocko
2012-10-31 13:18         ` Michal Hocko
2012-10-29 15:20 ` [V5 PATCH 09/26] oom: " Lai Jiangshan
2012-10-29 15:20   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 10/26] mm,migrate: " Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 11/26] mempolicy: " Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 12/26] hugetlb: " Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 13/26] vmstat: " Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 14/26] kthread: " Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 15/26] init: " Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 16/26] vmscan: " Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 17/26] page_alloc: use N_MEMORY instead N_HIGH_MEMORY change the node_states initialization Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 18/26] hotplug: update nodemasks management Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 19/26] numa: add CONFIG_MOVABLE_NODE for movable-dedicated node Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 20/26] memory_hotplug: allow online/offline memory to result movable node Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 21/26] page_alloc: add kernelcore_max_addr Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 22/26] x86: get pg_data_t's memory from other node Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 23/26] x86: use memblock_set_current_limit() to set memblock.current_limit Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 24/26] memblock: limit memory address from memblock Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 25/26] memblock: compare current_limit with end variable at memblock_find_in_range_node() Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-29 15:21 ` [V5 PATCH 26/26] mempolicy: fix is_valid_nodemask() Lai Jiangshan
2012-10-29 15:21   ` Lai Jiangshan
2012-10-30  9:50 ` [V5 PATCH 00/26] mm, memory-hotplug: dynamic configure movable memory and introduce movable node Yasuaki Ishimatsu
2012-10-31  9:30   ` Wen Congyang

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=5090CD48.30604@cn.fujitsu.com \
    --to=wency@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=dhillf@gmail.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=jiang.liu@huawei.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=rientjes@google.com \
    --cc=rusty@rustcorp.com.au \
    --cc=x86@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.