This is a note to let you know that I've just added the patch titled mm/hotplug: correctly add new zone to all other nodes' zone lists to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mm-hotplug-correctly-add-new-zone-to-all-other-nodes-zone-lists.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From jslaby@xxxxxxx Mon Apr 1 16:37:48 2013 From: Jiri Slaby <jslaby@xxxxxxx> Date: Tue, 19 Mar 2013 12:36:58 +0100 Subject: mm/hotplug: correctly add new zone to all other nodes' zone lists To: gregkh@xxxxxxxxxxxxxxxxxxx Cc: jirislaby@xxxxxxxxx, stable@xxxxxxxxxxxxxxx, Jiang Liu <jiang.liu@xxxxxxxxxx>, Jianguo Wu <wujianguo@xxxxxxxxxx>, Jiang Liu <liuj97@xxxxxxxxx>, Mel Gorman <mgorman@xxxxxxx>, Michal Hocko <mhocko@xxxxxxx>, Minchan Kim <minchan@xxxxxxxxxx>, Rusty Russell <rusty@xxxxxxxxxxxxxxx>, Yinghai Lu <yinghai@xxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>, KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>, David Rientjes <rientjes@xxxxxxxxxx>, Keping Chen <chenkeping@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>, Jiri Slaby <jslaby@xxxxxxx> Message-ID: <1363693019-14812-13-git-send-email-jslaby@xxxxxxx> From: Jiang Liu <jiang.liu@xxxxxxxxxx> commit 08dff7b7d629807dbb1f398c68dd9cd58dd657a1 upstream. When online_pages() is called to add new memory to an empty zone, it rebuilds all zone lists by calling build_all_zonelists(). But there's a bug which prevents the new zone to be added to other nodes' zone lists. online_pages() { build_all_zonelists() ..... node_set_state(zone_to_nid(zone), N_HIGH_MEMORY) } Here the node of the zone is put into N_HIGH_MEMORY state after calling build_all_zonelists(), but build_all_zonelists() only adds zones from nodes in N_HIGH_MEMORY state to the fallback zone lists. build_all_zonelists() ->__build_all_zonelists() ->build_zonelists() ->find_next_best_node() ->for_each_node_state(n, N_HIGH_MEMORY) So memory in the new zone will never be used by other nodes, and it may cause strange behavor when system is under memory pressure. So put node into N_HIGH_MEMORY state before calling build_all_zonelists(). Signed-off-by: Jianguo Wu <wujianguo@xxxxxxxxxx> Signed-off-by: Jiang Liu <liuj97@xxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx> Cc: Yinghai Lu <yinghai@xxxxxxxxxx> Cc: Tony Luck <tony.luck@xxxxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Keping Chen <chenkeping@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Jiri Slaby <jslaby@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- mm/memory_hotplug.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -453,19 +453,20 @@ int __ref online_pages(unsigned long pfn zone->present_pages += onlined_pages; zone->zone_pgdat->node_present_pages += onlined_pages; - if (need_zonelists_rebuild) - build_all_zonelists(zone); - else - zone_pcp_update(zone); + if (onlined_pages) { + node_set_state(zone_to_nid(zone), N_HIGH_MEMORY); + if (need_zonelists_rebuild) + build_all_zonelists(zone); + else + zone_pcp_update(zone); + } mutex_unlock(&zonelists_mutex); init_per_zone_wmark_min(); - if (onlined_pages) { + if (onlined_pages) kswapd_run(zone_to_nid(zone)); - node_set_state(zone_to_nid(zone), N_HIGH_MEMORY); - } vm_total_pages = nr_free_pagecache_pages(); Patches currently in stable-queue which might be from jslaby@xxxxxxx are queue-3.0/kvm-x86-prevent-starting-pit-timers-in-the-absence-of-irqchip-support.patch queue-3.0/kvm-x86-invalid-opcode-oops-on-set_sregs-with-osxsave-bit-set-cve-2012-4461.patch queue-3.0/mm-hotplug-correctly-add-new-zone-to-all-other-nodes-zone-lists.patch queue-3.0/macvtap-zerocopy-validate-vectors-before-building-skb.patch queue-3.0/x25-validate-incoming-call-user-data-lengths.patch queue-3.0/batman-adv-bat_socket_read-missing-checks.patch queue-3.0/kvm-fix-buffer-overflow-in-kvm_set_irq.patch queue-3.0/x25-handle-undersized-fragmented-skbs.patch queue-3.0/nfsv4-include-bitmap-in-nfsv4-get-acl-data.patch queue-3.0/nfs-nfs_getaclargs.acl_len-is-a-size_t.patch queue-3.0/nfsv4-fix-an-oops-in-the-nfsv4-getacl-code.patch queue-3.0/kvm-clean-up-error-handling-during-vcpu-creation.patch queue-3.0/kvm-ensure-all-vcpus-are-consistent-with-in-kernel-irqchip-settings.patch queue-3.0/batman-adv-only-write-requested-number-of-byte-to-user-buffer.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html