diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-02 19:29:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-02 19:29:19 -0400 |
commit | f929d3995d61ee0ff5d35e9f3fbef3b80bf4ccaa (patch) | |
tree | 12378638e4eb6cf56036029e4a6bc4e38478005c /mm | |
parent | b601ce0fe3aafadba21cd42eb3d63660010e2a2b (diff) | |
parent | abe5f972912d086c080be4bde67750630b6fb38b (diff) |
Merge branch 'akpm' (fixes from Andrew Morton)
Merge fixes from Andrew Morton:
"5 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm: page_alloc: fix zone allocation fairness on UP
perf: fix perf bug in fork()
MAINTAINERS: change git URL for mpc5xxx tree
mm: memcontrol: do not iterate uninitialized memcgs
ocfs2/dlm: should put mle when goto kill in dlm_assert_master_handler
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 36 | ||||
-rw-r--r-- | mm/page_alloc.c | 7 |
2 files changed, 34 insertions, 9 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 085dc6d2f876..28928ce9b07f 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -292,6 +292,9 @@ struct mem_cgroup { | |||
292 | /* vmpressure notifications */ | 292 | /* vmpressure notifications */ |
293 | struct vmpressure vmpressure; | 293 | struct vmpressure vmpressure; |
294 | 294 | ||
295 | /* css_online() has been completed */ | ||
296 | int initialized; | ||
297 | |||
295 | /* | 298 | /* |
296 | * the counter to account for mem+swap usage. | 299 | * the counter to account for mem+swap usage. |
297 | */ | 300 | */ |
@@ -1099,10 +1102,21 @@ skip_node: | |||
1099 | * skipping css reference should be safe. | 1102 | * skipping css reference should be safe. |
1100 | */ | 1103 | */ |
1101 | if (next_css) { | 1104 | if (next_css) { |
1102 | if ((next_css == &root->css) || | 1105 | struct mem_cgroup *memcg = mem_cgroup_from_css(next_css); |
1103 | ((next_css->flags & CSS_ONLINE) && | 1106 | |
1104 | css_tryget_online(next_css))) | 1107 | if (next_css == &root->css) |
1105 | return mem_cgroup_from_css(next_css); | 1108 | return memcg; |
1109 | |||
1110 | if (css_tryget_online(next_css)) { | ||
1111 | /* | ||
1112 | * Make sure the memcg is initialized: | ||
1113 | * mem_cgroup_css_online() orders the the | ||
1114 | * initialization against setting the flag. | ||
1115 | */ | ||
1116 | if (smp_load_acquire(&memcg->initialized)) | ||
1117 | return memcg; | ||
1118 | css_put(next_css); | ||
1119 | } | ||
1106 | 1120 | ||
1107 | prev_css = next_css; | 1121 | prev_css = next_css; |
1108 | goto skip_node; | 1122 | goto skip_node; |
@@ -5549,6 +5563,7 @@ mem_cgroup_css_online(struct cgroup_subsys_state *css) | |||
5549 | { | 5563 | { |
5550 | struct mem_cgroup *memcg = mem_cgroup_from_css(css); | 5564 | struct mem_cgroup *memcg = mem_cgroup_from_css(css); |
5551 | struct mem_cgroup *parent = mem_cgroup_from_css(css->parent); | 5565 | struct mem_cgroup *parent = mem_cgroup_from_css(css->parent); |
5566 | int ret; | ||
5552 | 5567 | ||
5553 | if (css->id > MEM_CGROUP_ID_MAX) | 5568 | if (css->id > MEM_CGROUP_ID_MAX) |
5554 | return -ENOSPC; | 5569 | return -ENOSPC; |
@@ -5585,7 +5600,18 @@ mem_cgroup_css_online(struct cgroup_subsys_state *css) | |||
5585 | } | 5600 | } |
5586 | mutex_unlock(&memcg_create_mutex); | 5601 | mutex_unlock(&memcg_create_mutex); |
5587 | 5602 | ||
5588 | return memcg_init_kmem(memcg, &memory_cgrp_subsys); | 5603 | ret = memcg_init_kmem(memcg, &memory_cgrp_subsys); |
5604 | if (ret) | ||
5605 | return ret; | ||
5606 | |||
5607 | /* | ||
5608 | * Make sure the memcg is initialized: mem_cgroup_iter() | ||
5609 | * orders reading memcg->initialized against its callers | ||
5610 | * reading the memcg members. | ||
5611 | */ | ||
5612 | smp_store_release(&memcg->initialized, 1); | ||
5613 | |||
5614 | return 0; | ||
5589 | } | 5615 | } |
5590 | 5616 | ||
5591 | /* | 5617 | /* |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 18cee0d4c8a2..eee961958021 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1612,7 +1612,7 @@ again: | |||
1612 | } | 1612 | } |
1613 | 1613 | ||
1614 | __mod_zone_page_state(zone, NR_ALLOC_BATCH, -(1 << order)); | 1614 | __mod_zone_page_state(zone, NR_ALLOC_BATCH, -(1 << order)); |
1615 | if (zone_page_state(zone, NR_ALLOC_BATCH) == 0 && | 1615 | if (atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]) <= 0 && |
1616 | !zone_is_fair_depleted(zone)) | 1616 | !zone_is_fair_depleted(zone)) |
1617 | zone_set_flag(zone, ZONE_FAIR_DEPLETED); | 1617 | zone_set_flag(zone, ZONE_FAIR_DEPLETED); |
1618 | 1618 | ||
@@ -5701,9 +5701,8 @@ static void __setup_per_zone_wmarks(void) | |||
5701 | zone->watermark[WMARK_HIGH] = min_wmark_pages(zone) + (tmp >> 1); | 5701 | zone->watermark[WMARK_HIGH] = min_wmark_pages(zone) + (tmp >> 1); |
5702 | 5702 | ||
5703 | __mod_zone_page_state(zone, NR_ALLOC_BATCH, | 5703 | __mod_zone_page_state(zone, NR_ALLOC_BATCH, |
5704 | high_wmark_pages(zone) - | 5704 | high_wmark_pages(zone) - low_wmark_pages(zone) - |
5705 | low_wmark_pages(zone) - | 5705 | atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH])); |
5706 | zone_page_state(zone, NR_ALLOC_BATCH)); | ||
5707 | 5706 | ||
5708 | setup_zone_migrate_reserve(zone); | 5707 | setup_zone_migrate_reserve(zone); |
5709 | spin_unlock_irqrestore(&zone->lock, flags); | 5708 | spin_unlock_irqrestore(&zone->lock, flags); |