diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e3086d0fd945..0bea94af0423 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5131,17 +5131,14 @@ static void setup_pageset(struct per_cpu_pageset *p, unsigned long batch); | |||
5131 | static DEFINE_PER_CPU(struct per_cpu_pageset, boot_pageset); | 5131 | static DEFINE_PER_CPU(struct per_cpu_pageset, boot_pageset); |
5132 | static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats); | 5132 | static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats); |
5133 | 5133 | ||
5134 | /* | ||
5135 | * Global mutex to protect against size modification of zonelists | ||
5136 | * as well as to serialize pageset setup for the new populated zone. | ||
5137 | */ | ||
5138 | DEFINE_MUTEX(zonelists_mutex); | ||
5139 | |||
5140 | static void __build_all_zonelists(void *data) | 5134 | static void __build_all_zonelists(void *data) |
5141 | { | 5135 | { |
5142 | int nid; | 5136 | int nid; |
5143 | int __maybe_unused cpu; | 5137 | int __maybe_unused cpu; |
5144 | pg_data_t *self = data; | 5138 | pg_data_t *self = data; |
5139 | static DEFINE_SPINLOCK(lock); | ||
5140 | |||
5141 | spin_lock(&lock); | ||
5145 | 5142 | ||
5146 | #ifdef CONFIG_NUMA | 5143 | #ifdef CONFIG_NUMA |
5147 | memset(node_load, 0, sizeof(node_load)); | 5144 | memset(node_load, 0, sizeof(node_load)); |
@@ -5173,6 +5170,8 @@ static void __build_all_zonelists(void *data) | |||
5173 | set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu))); | 5170 | set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu))); |
5174 | #endif | 5171 | #endif |
5175 | } | 5172 | } |
5173 | |||
5174 | spin_unlock(&lock); | ||
5176 | } | 5175 | } |
5177 | 5176 | ||
5178 | static noinline void __init | 5177 | static noinline void __init |
@@ -5203,7 +5202,6 @@ build_all_zonelists_init(void) | |||
5203 | } | 5202 | } |
5204 | 5203 | ||
5205 | /* | 5204 | /* |
5206 | * Called with zonelists_mutex held always | ||
5207 | * unless system_state == SYSTEM_BOOTING. | 5205 | * unless system_state == SYSTEM_BOOTING. |
5208 | * | 5206 | * |
5209 | * __ref due to call of __init annotated helper build_all_zonelists_init | 5207 | * __ref due to call of __init annotated helper build_all_zonelists_init |
@@ -6939,9 +6937,11 @@ static void __setup_per_zone_wmarks(void) | |||
6939 | */ | 6937 | */ |
6940 | void setup_per_zone_wmarks(void) | 6938 | void setup_per_zone_wmarks(void) |
6941 | { | 6939 | { |
6942 | mutex_lock(&zonelists_mutex); | 6940 | static DEFINE_SPINLOCK(lock); |
6941 | |||
6942 | spin_lock(&lock); | ||
6943 | __setup_per_zone_wmarks(); | 6943 | __setup_per_zone_wmarks(); |
6944 | mutex_unlock(&zonelists_mutex); | 6944 | spin_unlock(&lock); |
6945 | } | 6945 | } |
6946 | 6946 | ||
6947 | /* | 6947 | /* |