Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284367
b: refs/heads/master
c: b95a2f2
h: refs/heads/master
i:
  284365: 3ace0d5
  284363: 9c21feb
  284359: ab85276
  284351: 80a39ad
v: v3
  • Loading branch information
Johannes Weiner authored and Linus Torvalds committed Jan 13, 2012
1 parent f9a3c22 commit 4e823b0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad2b8e601099a23dffffb53f91c18d874fe98854
refs/heads/master: b95a2f2d486d0d768a92879c023a03757b9c7e58
39 changes: 22 additions & 17 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ static void get_scan_count(struct mem_cgroup_zone *mz, struct scan_control *sc,
* latencies, so it's better to scan a minimum amount there as
* well.
*/
if (current_is_kswapd())
if (current_is_kswapd() && mz->zone->all_unreclaimable)
force_scan = true;
if (!global_reclaim(sc))
force_scan = true;
Expand Down Expand Up @@ -2111,16 +2111,6 @@ static void shrink_zone(int priority, struct zone *zone,
};
struct mem_cgroup *memcg;

if (global_reclaim(sc)) {
struct mem_cgroup_zone mz = {
.mem_cgroup = NULL,
.zone = zone,
};

shrink_mem_cgroup_zone(priority, &mz, sc);
return;
}

memcg = mem_cgroup_iter(root, NULL, &reclaim);
do {
struct mem_cgroup_zone mz = {
Expand All @@ -2134,6 +2124,10 @@ static void shrink_zone(int priority, struct zone *zone,
* scanned it with decreasing priority levels until
* nr_to_reclaim had been reclaimed. This priority
* cycle is thus over after a single memcg.
*
* Direct reclaim and kswapd, on the other hand, have
* to scan all memory cgroups to fulfill the overall
* scan target for the zone.
*/
if (!global_reclaim(sc)) {
mem_cgroup_iter_break(root, memcg);
Expand Down Expand Up @@ -2478,13 +2472,24 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont,
static void age_active_anon(struct zone *zone, struct scan_control *sc,
int priority)
{
struct mem_cgroup_zone mz = {
.mem_cgroup = NULL,
.zone = zone,
};
struct mem_cgroup *memcg;

if (inactive_anon_is_low(&mz))
shrink_active_list(SWAP_CLUSTER_MAX, &mz, sc, priority, 0);
if (!total_swap_pages)
return;

memcg = mem_cgroup_iter(NULL, NULL, NULL);
do {
struct mem_cgroup_zone mz = {
.mem_cgroup = memcg,
.zone = zone,
};

if (inactive_anon_is_low(&mz))
shrink_active_list(SWAP_CLUSTER_MAX, &mz,
sc, priority, 0);

memcg = mem_cgroup_iter(NULL, memcg, NULL);
} while (memcg);
}

/*
Expand Down

0 comments on commit 4e823b0

Please sign in to comment.