Commit 3dd9fe8c authored by KAMEZAWA Hiroyuki's avatar KAMEZAWA Hiroyuki Committed by Linus Torvalds

memory unplug: isolate_lru_page fix

release_pages() in mm/swap.c changes page_count() to be 0 without removing
PageLRU flag...

This means isolate_lru_page() can see a page, PageLRU() &&
page_count(page)==0..  This is BUG.  (get_page() will be called against
count=0 page.)
Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dc386d4d
...@@ -49,9 +49,8 @@ int isolate_lru_page(struct page *page, struct list_head *pagelist) ...@@ -49,9 +49,8 @@ int isolate_lru_page(struct page *page, struct list_head *pagelist)
struct zone *zone = page_zone(page); struct zone *zone = page_zone(page);
spin_lock_irq(&zone->lru_lock); spin_lock_irq(&zone->lru_lock);
if (PageLRU(page)) { if (PageLRU(page) && get_page_unless_zero(page)) {
ret = 0; ret = 0;
get_page(page);
ClearPageLRU(page); ClearPageLRU(page);
if (PageActive(page)) if (PageActive(page))
del_page_from_active_list(zone, page); del_page_from_active_list(zone, page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment