mm: fix incorrect page removal from LRU
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Mon, 22 Jun 2009 23:57:55 +0000 (08:57 +0900)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 23 Jun 2009 17:17:28 +0000 (10:17 -0700)
The isolated page is "cursor_page" not "page".

This could cause LRU list corruption under memory pressure, caught by
CONFIG_DEBUG_LIST.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Tested-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c

index e8fa2d9eb212d7cfb739f02305a340fbf023565d..54155268dfcae49634dc016bb168845600a866a0 100644 (file)
@@ -932,7 +932,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
                                continue;
                        if (__isolate_lru_page(cursor_page, mode, file) == 0) {
                                list_move(&cursor_page->lru, dst);
-                               mem_cgroup_del_lru(page);
+                               mem_cgroup_del_lru(cursor_page);
                                nr_taken++;
                                scan++;
                        }