Skip to content

Commit

Permalink
setup_per_zone_pages_min(): take zone->lock instead of zone->lru_lock
Browse files Browse the repository at this point in the history
This replaces zone->lru_lock in setup_per_zone_pages_min() with zone->lock.
There seems to be no need for the lru_lock anymore, but there is a need for
zone->lock instead, because that function may call move_freepages() via
setup_zone_migrate_reserve().

Signed-off-by: Gerald Schaefer <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Tested-by: Yasunori Goto <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
gerald-schaefer authored and torvalds committed Oct 20, 2008
1 parent 4b2e38a commit 1125b4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4242,7 +4242,7 @@ void setup_per_zone_pages_min(void)
for_each_zone(zone) {
u64 tmp;

spin_lock_irqsave(&zone->lru_lock, flags);
spin_lock_irqsave(&zone->lock, flags);
tmp = (u64)pages_min * zone->present_pages;
do_div(tmp, lowmem_pages);
if (is_highmem(zone)) {
Expand Down Expand Up @@ -4274,7 +4274,7 @@ void setup_per_zone_pages_min(void)
zone->pages_low = zone->pages_min + (tmp >> 2);
zone->pages_high = zone->pages_min + (tmp >> 1);
setup_zone_migrate_reserve(zone);
spin_unlock_irqrestore(&zone->lru_lock, flags);
spin_unlock_irqrestore(&zone->lock, flags);
}

/* update totalreserve_pages */
Expand Down

0 comments on commit 1125b4e

Please sign in to comment.