Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207272
b: refs/heads/master
c: 4dc4b3d
h: refs/heads/master
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed Aug 10, 2010
1 parent 5d8e89e commit 5132289
Show file tree
Hide file tree
Showing 2 changed files with 14 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: 57250a5bf0f6ff68dc339572adbd881a11f366fa
refs/heads/master: 4dc4b3d971b23e12d483ba9f3b93b648c54b298a
17 changes: 13 additions & 4 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2635,10 +2635,19 @@ 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.
*/
while (shrink_slab(sc.nr_scanned, gfp_mask, order) &&
(zone_page_state(zone, NR_SLAB_RECLAIMABLE) + nr_pages >
nr_slab_pages0))
;
for (;;) {
unsigned long lru_pages = zone_reclaimable_pages(zone);

/* No reclaimable slab or very low memory pressure */
if (!shrink_slab(sc.nr_scanned, gfp_mask, lru_pages))
break;

/* Freed enough memory */
nr_slab_pages1 = zone_page_state(zone,
NR_SLAB_RECLAIMABLE);
if (nr_slab_pages1 + nr_pages <= nr_slab_pages0)
break;
}

/*
* Update nr_reclaimed by the number of slab pages we
Expand Down

0 comments on commit 5132289

Please sign in to comment.