Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35601
b: refs/heads/master
c: 4ff1ffb
h: refs/heads/master
i:
  35599: 323bfcc
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Sep 26, 2006
1 parent 240e61c commit 7fc74d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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: 408d85441cd5a9bd6bc851d677a10c605ed8db5f
refs/heads/master: 4ff1ffb4870b007b86f21e5f27eeb11498c4c077
11 changes: 10 additions & 1 deletion trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,11 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
return nr_reclaimed;
}

static inline int zone_is_near_oom(struct zone *zone)
{
return zone->pages_scanned >= (zone->nr_active + zone->nr_inactive)*3;
}

/*
* This moves pages from the active list to the inactive list.
*
Expand Down Expand Up @@ -732,6 +737,9 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
long distress;
long swap_tendency;

if (zone_is_near_oom(zone))
goto force_reclaim_mapped;

/*
* `distress' is a measure of how much trouble we're having
* reclaiming pages. 0 -> no problems. 100 -> great trouble.
Expand Down Expand Up @@ -767,6 +775,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
* memory onto the inactive list.
*/
if (swap_tendency >= 100)
force_reclaim_mapped:
reclaim_mapped = 1;
}

Expand Down Expand Up @@ -1161,7 +1170,7 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order)
if (zone->all_unreclaimable)
continue;
if (nr_slab == 0 && zone->pages_scanned >=
(zone->nr_active + zone->nr_inactive) * 4)
(zone->nr_active + zone->nr_inactive) * 6)
zone->all_unreclaimable = 1;
/*
* If we've done a decent amount of scanning and
Expand Down

0 comments on commit 7fc74d2

Please sign in to comment.