Commit b1aff7fc authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

revert "vmscan, memcg: do softlimit reclaim also for targeted reclaim"

Revert commit a5b7c87f ("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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 694fbc0f
...@@ -234,8 +234,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page, ...@@ -234,8 +234,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page,
mem_cgroup_update_page_stat(page, idx, -1); mem_cgroup_update_page_stat(page, idx, -1);
} }
bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg, bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg);
struct mem_cgroup *root);
void __mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); void __mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
static inline void mem_cgroup_count_vm_event(struct mm_struct *mm, 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,8 +434,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page,
} }
static inline static inline
bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg, bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg)
struct mem_cgroup *root)
{ {
return false; return false;
} }
......
...@@ -1760,13 +1760,11 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg) ...@@ -1760,13 +1760,11 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg)
#endif #endif
/* /*
* A group is eligible for the soft limit reclaim under the given root * A group is eligible for the soft limit reclaim if
* hierarchy if * a) it is over its soft limit
* a) it is over its soft limit
* b) any parent up the hierarchy is over its soft limit * b) any parent up the hierarchy is over its soft limit
*/ */
bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg, bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg)
struct mem_cgroup *root)
{ {
struct mem_cgroup *parent = memcg; struct mem_cgroup *parent = memcg;
...@@ -1774,14 +1772,12 @@ bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg, ...@@ -1774,14 +1772,12 @@ bool mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg,
return true; return true;
/* /*
* If any parent up to the root in the hierarchy is over its soft limit * If any parent up the hierarchy is over its soft limit then we
* then we have to obey and reclaim from this group as well. * have to obey and reclaim from this group as well.
*/ */
while ((parent = parent_mem_cgroup(parent))) { while ((parent = parent_mem_cgroup(parent))) {
if (res_counter_soft_limit_excess(&parent->res)) if (res_counter_soft_limit_excess(&parent->res))
return true; return true;
if (parent == root)
break;
} }
return false; return false;
......
...@@ -142,7 +142,7 @@ static bool global_reclaim(struct scan_control *sc) ...@@ -142,7 +142,7 @@ static bool global_reclaim(struct scan_control *sc)
static bool mem_cgroup_should_soft_reclaim(struct scan_control *sc) static bool mem_cgroup_should_soft_reclaim(struct scan_control *sc)
{ {
return !mem_cgroup_disabled(); return !mem_cgroup_disabled() && global_reclaim(sc);
} }
#else #else
static bool global_reclaim(struct scan_control *sc) 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,7 +2195,7 @@ __shrink_zone(struct zone *zone, struct scan_control *sc, bool soft_reclaim)
struct lruvec *lruvec; struct lruvec *lruvec;
if (soft_reclaim && if (soft_reclaim &&
!mem_cgroup_soft_reclaim_eligible(memcg, root)) { !mem_cgroup_soft_reclaim_eligible(memcg)) {
memcg = mem_cgroup_iter(root, memcg, &reclaim); memcg = mem_cgroup_iter(root, memcg, &reclaim);
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment