diff options
author | Johannes Weiner <hannes@saeurebad.de> | 2008-11-30 21:00:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-01 10:58:06 -0500 |
commit | 2a1dc509747fdcfdf3a2df818a14908aed86c3d4 (patch) | |
tree | 4dd97b3090d314b42f793a48251497f34835a5e8 /mm | |
parent | 33b07db9f38fe73b3895f8d4db8fdee03e3afec3 (diff) |
vmscan: protect zone rotation stats by lru lock
The zone's rotation statistics must not be accessed without the
corresponding LRU lock held. Fix an unprotected write in
shrink_active_list().
Acked-by: Rik van Riel <riel@redhat.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmscan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 7ea1440b53db..62e7f62fb559 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1248,6 +1248,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone, | |||
1248 | list_add(&page->lru, &l_inactive); | 1248 | list_add(&page->lru, &l_inactive); |
1249 | } | 1249 | } |
1250 | 1250 | ||
1251 | spin_lock_irq(&zone->lru_lock); | ||
1251 | /* | 1252 | /* |
1252 | * Count referenced pages from currently used mappings as | 1253 | * Count referenced pages from currently used mappings as |
1253 | * rotated, even though they are moved to the inactive list. | 1254 | * rotated, even though they are moved to the inactive list. |
@@ -1263,7 +1264,6 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone, | |||
1263 | 1264 | ||
1264 | pgmoved = 0; | 1265 | pgmoved = 0; |
1265 | lru = LRU_BASE + file * LRU_FILE; | 1266 | lru = LRU_BASE + file * LRU_FILE; |
1266 | spin_lock_irq(&zone->lru_lock); | ||
1267 | while (!list_empty(&l_inactive)) { | 1267 | while (!list_empty(&l_inactive)) { |
1268 | page = lru_to_page(&l_inactive); | 1268 | page = lru_to_page(&l_inactive); |
1269 | prefetchw_prev_lru_page(page, &l_inactive, flags); | 1269 | prefetchw_prev_lru_page(page, &l_inactive, flags); |