Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35629
b: refs/heads/master
c: 83e33a4
h: refs/heads/master
i:
  35627: e68da93
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Sep 26, 2006
1 parent d85806d commit e077e93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 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: 0ff38490c836dc379ff7ec45b10a15a662f4e5f6
refs/heads/master: 83e33a4711760469f5c3861b8ffea4947656d4eb
17 changes: 12 additions & 5 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,7 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
.gfp_mask = gfp_mask,
.swappiness = vm_swappiness,
};
unsigned long slab_reclaimable;

disable_swap_token();
cond_resched();
Expand All @@ -1592,7 +1593,8 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
} while (priority >= 0 && nr_reclaimed < nr_pages);
}

if (zone_page_state(zone, NR_SLAB_RECLAIMABLE) > zone->min_slab_pages) {
slab_reclaimable = zone_page_state(zone, NR_SLAB_RECLAIMABLE);
if (slab_reclaimable > zone->min_slab_pages) {
/*
* shrink_slab() does not currently allow us to determine how
* many pages were freed in this zone. So we take the current
Expand All @@ -1603,12 +1605,17 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
* Note that shrink_slab will free memory on all zones and may
* take a long time.
*/
unsigned long limit = zone_page_state(zone,
NR_SLAB_RECLAIMABLE) - nr_pages;

while (shrink_slab(sc.nr_scanned, gfp_mask, order) &&
zone_page_state(zone, NR_SLAB_RECLAIMABLE) > limit)
zone_page_state(zone, NR_SLAB_RECLAIMABLE) >
slab_reclaimable - nr_pages)
;

/*
* Update nr_reclaimed by the number of slab pages we
* reclaimed from this zone.
*/
nr_reclaimed += slab_reclaimable -
zone_page_state(zone, NR_SLAB_RECLAIMABLE);
}

p->reclaim_state = NULL;
Expand Down

0 comments on commit e077e93

Please sign in to comment.