diff options
author | Alex Shi <alex.shi@linaro.org> | 2014-03-28 10:58:52 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2014-03-28 10:58:52 +0800 |
commit | 02e11cd17332186b4cf9ed88db6e63b30043be54 (patch) | |
tree | bc3a5683d5d3139e1825b69796fb8480808ba46f /mm | |
parent | d3222d77b27a07a4b200d1b0b792e8e3bdf30396 (diff) | |
parent | 10f8245e0d3650144b034142c8f91e5d15c392ab (diff) |
Merge tag 'v3.10.34' into linux-linaro-lsk
This is 3.10.34 stable release
Diffstat (limited to 'mm')
-rw-r--r-- | mm/compaction.c | 20 | ||||
-rw-r--r-- | mm/memcontrol.c | 14 |
2 files changed, 27 insertions, 7 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 9a3e351da29b..18a90b4d0bfc 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -252,7 +252,6 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, { int nr_scanned = 0, total_isolated = 0; struct page *cursor, *valid_page = NULL; - unsigned long nr_strict_required = end_pfn - blockpfn; unsigned long flags; bool locked = false; @@ -265,11 +264,12 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, nr_scanned++; if (!pfn_valid_within(blockpfn)) - continue; + goto isolate_fail; + if (!valid_page) valid_page = page; if (!PageBuddy(page)) - continue; + goto isolate_fail; /* * The zone lock must be held to isolate freepages. @@ -290,12 +290,10 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, /* Recheck this is a buddy page under lock */ if (!PageBuddy(page)) - continue; + goto isolate_fail; /* Found a free page, break it into order-0 pages */ isolated = split_free_page(page); - if (!isolated && strict) - break; total_isolated += isolated; for (i = 0; i < isolated; i++) { list_add(&page->lru, freelist); @@ -306,7 +304,15 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, if (isolated) { blockpfn += isolated - 1; cursor += isolated - 1; + continue; } + +isolate_fail: + if (strict) + break; + else + continue; + } trace_mm_compaction_isolate_freepages(nr_scanned, total_isolated); @@ -316,7 +322,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, * pages requested were isolated. If there were any failures, 0 is * returned and CMA will fail. */ - if (strict && nr_strict_required > total_isolated) + if (strict && blockpfn < end_pfn) total_isolated = 0; if (locked) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6115b2bbd6ea..f45e21ab9cea 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6326,9 +6326,23 @@ static void mem_cgroup_invalidate_reclaim_iterators(struct mem_cgroup *memcg) static void mem_cgroup_css_offline(struct cgroup *cont) { struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); + struct cgroup *iter; mem_cgroup_invalidate_reclaim_iterators(memcg); + + /* + * This requires that offlining is serialized. Right now that is + * guaranteed because css_killed_work_fn() holds the cgroup_mutex. + */ + rcu_read_lock(); + cgroup_for_each_descendant_post(iter, cont) { + rcu_read_unlock(); + mem_cgroup_reparent_charges(mem_cgroup_from_cont(iter)); + rcu_read_lock(); + } + rcu_read_unlock(); mem_cgroup_reparent_charges(memcg); + mem_cgroup_destroy_all_caches(memcg); } |