Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356500
b: refs/heads/master
c: dafcb73
h: refs/heads/master
v: v3
  • Loading branch information
Zlatko Calusic authored and Linus Torvalds committed Feb 24, 2013
1 parent f5237fe commit 3b002e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: 7103f16dbff20fa969c9500902d980d17f953fa6
refs/heads/master: dafcb73e385e39b9a7ebd5c4ecbc4ae921862eb9
15 changes: 11 additions & 4 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2616,6 +2616,7 @@ static bool prepare_kswapd_sleep(pg_data_t *pgdat, int order, long remaining,
static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
int *classzone_idx)
{
bool pgdat_is_balanced = false;
struct zone *unbalanced_zone;
int i;
int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */
Expand Down Expand Up @@ -2690,8 +2691,11 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
zone_clear_flag(zone, ZONE_CONGESTED);
}
}
if (i < 0)

if (i < 0) {
pgdat_is_balanced = true;
goto out;
}

for (i = 0; i <= end_zone; i++) {
struct zone *zone = pgdat->node_zones + i;
Expand Down Expand Up @@ -2818,8 +2822,11 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
pfmemalloc_watermark_ok(pgdat))
wake_up(&pgdat->pfmemalloc_wait);

if (pgdat_balanced(pgdat, order, *classzone_idx))
if (pgdat_balanced(pgdat, order, *classzone_idx)) {
pgdat_is_balanced = true;
break; /* kswapd: all done */
}

/*
* OK, kswapd is getting into trouble. Take a nap, then take
* another pass across the zones.
Expand All @@ -2840,9 +2847,9 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
if (sc.nr_reclaimed >= SWAP_CLUSTER_MAX)
break;
} while (--sc.priority >= 0);
out:

if (!pgdat_balanced(pgdat, order, *classzone_idx)) {
out:
if (!pgdat_is_balanced) {
cond_resched();

try_to_freeze();
Expand Down

0 comments on commit 3b002e6

Please sign in to comment.