Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19372
b: refs/heads/master
c: a92f712
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 1, 2006
1 parent 56ba5ce commit 0c84b88
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 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: aa3f18b3391ac305baa01faead3fdf9147daf54b
refs/heads/master: a92f71263af9d0ab77c260f709c0c079656221aa
20 changes: 18 additions & 2 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,14 @@ int zone_reclaim_mode __read_mostly;
* Mininum time between zone reclaim scans
*/
#define ZONE_RECLAIM_INTERVAL 30*HZ

/*
* Priority for ZONE_RECLAIM. This determines the fraction of pages
* of a node considered for each zone_reclaim. 4 scans 1/16th of
* a zone.
*/
#define ZONE_RECLAIM_PRIORITY 4

/*
* Try to free up some pages from this zone through reclaim.
*/
Expand Down Expand Up @@ -1626,7 +1634,7 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
sc.may_swap = 0;
sc.nr_scanned = 0;
sc.nr_reclaimed = 0;
sc.priority = 0;
sc.priority = ZONE_RECLAIM_PRIORITY + 1;
sc.nr_mapped = read_page_state(nr_mapped);
sc.gfp_mask = gfp_mask;

Expand All @@ -1643,7 +1651,15 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
reclaim_state.reclaimed_slab = 0;
p->reclaim_state = &reclaim_state;

shrink_zone(zone, &sc);
/*
* Free memory by calling shrink zone with increasing priorities
* until we have enough memory freed.
*/
do {
sc.priority--;
shrink_zone(zone, &sc);

} while (sc.nr_reclaimed < nr_pages && sc.priority > 0);

p->reclaim_state = NULL;
current->flags &= ~PF_MEMALLOC;
Expand Down

0 comments on commit 0c84b88

Please sign in to comment.