aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 21c52d2d8624..08b349931ebc 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2571,8 +2571,11 @@ int numa_zonelist_order_handler(ctl_table *table, int write,
2571 strncpy((char*)table->data, saved_string, 2571 strncpy((char*)table->data, saved_string,
2572 NUMA_ZONELIST_ORDER_LEN); 2572 NUMA_ZONELIST_ORDER_LEN);
2573 user_zonelist_order = oldval; 2573 user_zonelist_order = oldval;
2574 } else if (oldval != user_zonelist_order) 2574 } else if (oldval != user_zonelist_order) {
2575 mutex_lock(&zonelists_mutex);
2575 build_all_zonelists(NULL); 2576 build_all_zonelists(NULL);
2577 mutex_unlock(&zonelists_mutex);
2578 }
2576 } 2579 }
2577out: 2580out:
2578 mutex_unlock(&zl_order_mutex); 2581 mutex_unlock(&zl_order_mutex);
@@ -2924,6 +2927,12 @@ static void setup_pageset(struct per_cpu_pageset *p, unsigned long batch);
2924static DEFINE_PER_CPU(struct per_cpu_pageset, boot_pageset); 2927static DEFINE_PER_CPU(struct per_cpu_pageset, boot_pageset);
2925static void setup_zone_pageset(struct zone *zone); 2928static void setup_zone_pageset(struct zone *zone);
2926 2929
2930/*
2931 * Global mutex to protect against size modification of zonelists
2932 * as well as to serialize pageset setup for the new populated zone.
2933 */
2934DEFINE_MUTEX(zonelists_mutex);
2935
2927/* return values int ....just for stop_machine() */ 2936/* return values int ....just for stop_machine() */
2928static __init_refok int __build_all_zonelists(void *data) 2937static __init_refok int __build_all_zonelists(void *data)
2929{ 2938{
@@ -2967,6 +2976,10 @@ static __init_refok int __build_all_zonelists(void *data)
2967 return 0; 2976 return 0;
2968} 2977}
2969 2978
2979/*
2980 * Called with zonelists_mutex held always
2981 * unless system_state == SYSTEM_BOOTING.
2982 */
2970void build_all_zonelists(void *data) 2983void build_all_zonelists(void *data)
2971{ 2984{
2972 set_zonelist_order(); 2985 set_zonelist_order();