diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2013-09-24 18:27:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-24 20:00:26 -0400 |
commit | b1aff7fcf86c88472b0a70f15d89d7a4adba07bb (patch) | |
tree | 00a1b6194f6abe8a93a1bfb180365800a2873b65 | |
parent | 694fbc0fe78518d06efa63910bf4ecee660e7852 (diff) |
revert "vmscan, memcg: do softlimit reclaim also for targeted reclaim"
Revert commit a5b7c87f9207 ("vmscan, memcg: do softlimit reclaim also
for targeted reclaim")
I merged this prematurely - Michal and Johannes still disagree about the
overall design direction and the future remains unclear.
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/memcontrol.h | 6 | ||||
-rw-r--r-- | mm/memcontrol.c | 14 | ||||
-rw-r--r-- | mm/vmscan.c | 4 |
3 files changed, 9 insertions, 15 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index ef2b9bd7fafa..6054c9f3a5e8 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -234,8 +234,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page, | |||
234 | mem_cgroup_update_page_stat(page, idx, -1); | 234 | mem_cgroup_update_page_stat(page, idx, -1); |
235 | } | 235 | } |
236 | 236 | ||
237 | bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg, | 237 | bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg); |
238 | struct mem_cgroup *root); | ||
239 | 238 | ||
240 | void __mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); | 239 | void __mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); |
241 | static inline void mem_cgroup_count_vm_event(struct mm_struct *mm, | 240 | static inline void mem_cgroup_count_vm_event(struct mm_struct *mm, |
@@ -435,8 +434,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page, | |||
435 | } | 434 | } |
436 | 435 | ||
437 | static inline | 436 | static inline |
438 | bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg, | 437 | bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg) |
439 | struct mem_cgroup *root) | ||
440 | { | 438 | { |
441 | return false; | 439 | return false; |
442 | } | 440 | } |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 65e7bec4b0f0..47cdc7eb1a6b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -1760,13 +1760,11 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg) | |||
1760 | #endif | 1760 | #endif |
1761 | 1761 | ||
1762 | /* | 1762 | /* |
1763 | * A group is eligible for the soft limit reclaim under the given root | 1763 | * A group is eligible for the soft limit reclaim if |
1764 | * hierarchy if | 1764 | * a) it is over its soft limit |
1765 | * a) it is over its soft limit | ||
1766 | * b) any parent up the hierarchy is over its soft limit | 1765 | * b) any parent up the hierarchy is over its soft limit |
1767 | */ | 1766 | */ |
1768 | bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg, | 1767 | bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg) |
1769 | struct mem_cgroup *root) | ||
1770 | { | 1768 | { |
1771 | struct mem_cgroup *parent = memcg; | 1769 | struct mem_cgroup *parent = memcg; |
1772 | 1770 | ||
@@ -1774,14 +1772,12 @@ bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg, | |||
1774 | return true; | 1772 | return true; |
1775 | 1773 | ||
1776 | /* | 1774 | /* |
1777 | * If any parent up to the root in the hierarchy is over its soft limit | 1775 | * If any parent up the hierarchy is over its soft limit then we |
1778 | * then we have to obey and reclaim from this group as well. | 1776 | * have to obey and reclaim from this group as well. |
1779 | */ | 1777 | */ |
1780 | while ((parent = parent_mem_cgroup(parent))) { | 1778 | while ((parent = parent_mem_cgroup(parent))) { |
1781 | if (res_counter_soft_limit_excess(&parent->res)) | 1779 | if (res_counter_soft_limit_excess(&parent->res)) |
1782 | return true; | 1780 | return true; |
1783 | if (parent == root) | ||
1784 | break; | ||
1785 | } | 1781 | } |
1786 | 1782 | ||
1787 | return false; | 1783 | return false; |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 17a7134de4d7..0e081cada4ba 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -142,7 +142,7 @@ static bool global_reclaim(struct scan_control *sc) | |||
142 | 142 | ||
143 | static bool mem_cgroup_should_soft_reclaim(struct scan_control *sc) | 143 | static bool mem_cgroup_should_soft_reclaim(struct scan_control *sc) |
144 | { | 144 | { |
145 | return !mem_cgroup_disabled(); | 145 | return !mem_cgroup_disabled() && global_reclaim(sc); |
146 | } | 146 | } |
147 | #else | 147 | #else |
148 | static bool global_reclaim(struct scan_control *sc) | 148 | static bool global_reclaim(struct scan_control *sc) |
@@ -2195,7 +2195,7 @@ __shrink_zone(struct zone *zone, struct scan_control *sc, bool soft_reclaim) | |||
2195 | struct lruvec *lruvec; | 2195 | struct lruvec *lruvec; |
2196 | 2196 | ||
2197 | if (soft_reclaim && | 2197 | if (soft_reclaim && |
2198 | !mem_cgroup_soft_reclaim_eligible(memcg, root)) { | 2198 | !mem_cgroup_soft_reclaim_eligible(memcg)) { |
2199 | memcg = mem_cgroup_iter(root, memcg, &reclaim); | 2199 | memcg = mem_cgroup_iter(root, memcg, &reclaim); |
2200 | continue; | 2200 | continue; |
2201 | } | 2201 | } |