diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d79b92580561..d2a8889b4c58 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1222,10 +1222,10 @@ again: | |||
1222 | } | 1222 | } |
1223 | spin_lock_irqsave(&zone->lock, flags); | 1223 | spin_lock_irqsave(&zone->lock, flags); |
1224 | page = __rmqueue(zone, order, migratetype); | 1224 | page = __rmqueue(zone, order, migratetype); |
1225 | __mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order)); | ||
1226 | spin_unlock(&zone->lock); | 1225 | spin_unlock(&zone->lock); |
1227 | if (!page) | 1226 | if (!page) |
1228 | goto failed; | 1227 | goto failed; |
1228 | __mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order)); | ||
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | __count_zone_vm_events(PGALLOC, zone, 1 << order); | 1231 | __count_zone_vm_events(PGALLOC, zone, 1 << order); |
@@ -2402,13 +2402,14 @@ int numa_zonelist_order_handler(ctl_table *table, int write, | |||
2402 | { | 2402 | { |
2403 | char saved_string[NUMA_ZONELIST_ORDER_LEN]; | 2403 | char saved_string[NUMA_ZONELIST_ORDER_LEN]; |
2404 | int ret; | 2404 | int ret; |
2405 | static DEFINE_MUTEX(zl_order_mutex); | ||
2405 | 2406 | ||
2407 | mutex_lock(&zl_order_mutex); | ||
2406 | if (write) | 2408 | if (write) |
2407 | strncpy(saved_string, (char*)table->data, | 2409 | strcpy(saved_string, (char*)table->data); |
2408 | NUMA_ZONELIST_ORDER_LEN); | ||
2409 | ret = proc_dostring(table, write, buffer, length, ppos); | 2410 | ret = proc_dostring(table, write, buffer, length, ppos); |
2410 | if (ret) | 2411 | if (ret) |
2411 | return ret; | 2412 | goto out; |
2412 | if (write) { | 2413 | if (write) { |
2413 | int oldval = user_zonelist_order; | 2414 | int oldval = user_zonelist_order; |
2414 | if (__parse_numa_zonelist_order((char*)table->data)) { | 2415 | if (__parse_numa_zonelist_order((char*)table->data)) { |
@@ -2421,7 +2422,9 @@ int numa_zonelist_order_handler(ctl_table *table, int write, | |||
2421 | } else if (oldval != user_zonelist_order) | 2422 | } else if (oldval != user_zonelist_order) |
2422 | build_all_zonelists(); | 2423 | build_all_zonelists(); |
2423 | } | 2424 | } |
2424 | return 0; | 2425 | out: |
2426 | mutex_unlock(&zl_order_mutex); | ||
2427 | return ret; | ||
2425 | } | 2428 | } |
2426 | 2429 | ||
2427 | 2430 | ||
@@ -3995,7 +3998,7 @@ void __init add_active_range(unsigned int nid, unsigned long start_pfn, | |||
3995 | } | 3998 | } |
3996 | 3999 | ||
3997 | /* Merge backward if suitable */ | 4000 | /* Merge backward if suitable */ |
3998 | if (start_pfn < early_node_map[i].end_pfn && | 4001 | if (start_pfn < early_node_map[i].start_pfn && |
3999 | end_pfn >= early_node_map[i].start_pfn) { | 4002 | end_pfn >= early_node_map[i].start_pfn) { |
4000 | early_node_map[i].start_pfn = start_pfn; | 4003 | early_node_map[i].start_pfn = start_pfn; |
4001 | return; | 4004 | return; |