linux-stable/Documentation
Lai Jiangshan d9713679db memory_hotplug: fix possible incorrect node_states[N_NORMAL_MEMORY]
Currently memory_hotplug only manages the node_states[N_HIGH_MEMORY], it
forgets to manage node_states[N_NORMAL_MEMORY].  This may cause
node_states[N_NORMAL_MEMORY] to become incorrect.

Example, if a node is empty before online, and we online a memory which is
in ZONE_NORMAL.  And after online, node_states[N_HIGH_MEMORY] is correct,
but node_states[N_NORMAL_MEMORY] is incorrect, the online code doesn't set
the new online node to node_states[N_NORMAL_MEMORY].

The same thing will happen when offlining (the offline code doesn't clear
the node from node_states[N_NORMAL_MEMORY] when needed).  Some memory
managment code depends node_states[N_NORMAL_MEMORY], so we have to fix up
the node_states[N_NORMAL_MEMORY].

We add node_states_check_changes_online() and
node_states_check_changes_offline() to detect whether
node_states[N_HIGH_MEMORY] and node_states[N_NORMAL_MEMORY] are changed
while hotpluging.

Also add @status_change_nid_normal to struct memory_notify, thus the
memory hotplug callbacks know whether the node_states[N_NORMAL_MEMORY] are
changed.  (We can add a @flags and reuse @status_change_nid instead of
introducing @status_change_nid_normal, but it will add much more
complexity in memory hotplug callback in every subsystem.  So introducing
@status_change_nid_normal is better and it doesn't change the sematics of
@status_change_nid)

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Rob Landley <rob@landley.net>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-11 17:22:23 -08:00
..
2012-10-13 10:57:01 +09:00
2012-10-11 10:55:04 +01:00
2012-09-09 10:35:39 +02:00
2011-09-27 18:08:04 +02:00
2010-02-24 13:51:32 +01:00
2012-04-03 13:09:18 +02:00
2012-10-08 13:50:12 +10:30
2012-12-11 11:30:41 -08:00
2011-09-27 18:08:04 +02:00
2012-09-06 19:11:04 +01:00
2012-12-05 10:55:55 -08:00
2012-10-05 22:23:54 +02:00
2012-11-30 10:52:19 -06:00
2012-07-18 18:35:57 -07:00
2011-03-31 11:26:23 -03:00
2012-07-09 16:42:11 -04:00
2011-09-27 18:08:04 +02:00
2012-10-07 17:29:24 +09:00
2011-11-02 16:07:02 -07:00
2012-10-02 17:26:42 -07:00
2011-03-31 11:26:23 -03:00
2011-09-27 18:08:04 +02:00
2012-10-09 16:22:55 +09:00
2010-04-08 11:34:34 +02:00
2012-03-16 20:35:01 +00:00
2011-03-31 11:26:23 -03:00
2012-06-03 12:05:50 +02:00
2012-07-29 21:11:05 -03:00
2012-12-05 23:52:10 +00:00
2011-03-31 11:26:23 -03:00
2011-09-27 18:08:04 +02:00
2009-07-01 22:36:22 +02:00
2011-03-07 13:20:05 -08:00
2009-04-27 12:00:27 -07:00
2009-04-27 12:00:27 -07:00
2011-09-27 18:08:04 +02:00
2012-02-28 16:05:06 +01:00
2011-09-27 18:08:04 +02:00
2011-03-31 11:26:23 -03:00
2010-07-19 10:56:54 +02:00
2010-03-16 11:47:56 +01:00
2012-01-02 13:04:55 +01:00