Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14044
b: refs/heads/master
c: 669ed17
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Nov 14, 2005
1 parent bde609b commit ca6a51f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 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: 2d6c666e8704cf06267f29a4fa3d2cf823469c38
refs/heads/master: 669ed17521b9b78cdbeac8a53c30599aca9527ce
27 changes: 14 additions & 13 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2397,13 +2397,18 @@ void setup_per_zone_pages_min(void)
}

for_each_zone(zone) {
unsigned long tmp;
spin_lock_irqsave(&zone->lru_lock, flags);
tmp = (pages_min * zone->present_pages) / lowmem_pages;
if (is_highmem(zone)) {
/*
* Often, highmem doesn't need to reserve any pages.
* But the pages_min/low/high values are also used for
* batching up page reclaim activity so we need a
* decent value here.
* __GFP_HIGH and PF_MEMALLOC allocations usually don't
* need highmem pages, so cap pages_min to a small
* value here.
*
* The (pages_high-pages_low) and (pages_low-pages_min)
* deltas controls asynch page reclaim, and so should
* not be capped for highmem.
*/
int min_pages;

Expand All @@ -2414,19 +2419,15 @@ void setup_per_zone_pages_min(void)
min_pages = 128;
zone->pages_min = min_pages;
} else {
/* if it's a lowmem zone, reserve a number of pages
/*
* If it's a lowmem zone, reserve a number of pages
* proportionate to the zone's size.
*/
zone->pages_min = (pages_min * zone->present_pages) /
lowmem_pages;
zone->pages_min = tmp;
}

/*
* When interpreting these watermarks, just keep in mind that:
* zone->pages_min == (zone->pages_min * 4) / 4;
*/
zone->pages_low = (zone->pages_min * 5) / 4;
zone->pages_high = (zone->pages_min * 6) / 4;
zone->pages_low = zone->pages_min + tmp / 4;
zone->pages_high = zone->pages_min + tmp / 2;
spin_unlock_irqrestore(&zone->lru_lock, flags);
}
}
Expand Down

0 comments on commit ca6a51f

Please sign in to comment.