Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35600
b: refs/heads/master
c: 408d854
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Sep 26, 2006
1 parent 323bfcc commit 240e61c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6ddab3b9ebebc88bfdd8107c64f12d7e4480c559
refs/heads/master: 408d85441cd5a9bd6bc851d677a10c605ed8db5f
8 changes: 8 additions & 0 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ struct scan_control {
int swap_cluster_max;

int swappiness;

int all_unreclaimable;
};

/*
Expand Down Expand Up @@ -925,6 +927,7 @@ static unsigned long shrink_zones(int priority, struct zone **zones,
unsigned long nr_reclaimed = 0;
int i;

sc->all_unreclaimable = 1;
for (i = 0; zones[i] != NULL; i++) {
struct zone *zone = zones[i];

Expand All @@ -941,6 +944,8 @@ static unsigned long shrink_zones(int priority, struct zone **zones,
if (zone->all_unreclaimable && priority != DEF_PRIORITY)
continue; /* Let kswapd poll it */

sc->all_unreclaimable = 0;

nr_reclaimed += shrink_zone(priority, zone, sc);
}
return nr_reclaimed;
Expand Down Expand Up @@ -1021,6 +1026,9 @@ unsigned long try_to_free_pages(struct zone **zones, gfp_t gfp_mask)
if (sc.nr_scanned && priority < DEF_PRIORITY - 2)
blk_congestion_wait(WRITE, HZ/10);
}
/* top priority shrink_caches still had more to do? don't OOM, then */
if (!sc.all_unreclaimable)
ret = 1;
out:
for (i = 0; zones[i] != 0; i++) {
struct zone *zone = zones[i];
Expand Down

0 comments on commit 240e61c

Please sign in to comment.