From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 6 Jun 2008 22:11:24 +0900 From: Daisuke Nishimura Subject: memcg: bad page at page migration Message-Id: <20080606221124.623847aa.nishimura@mxp.nes.nec.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: KAMEZAWA Hiroyuki Cc: akpm@linux-foundation.org, balbir@linux.vnet.ibm.com, xemul@openvz.org, lizf@cn.fujitsu.com, yamamoto@valinux.co.jp, hugh@veritas.com, minchan.kim@gmail.com, linux-mm@kvack.org List-ID: Hi, Kamezawa-san. I found a bad page problem with your performance improvement patch set v4(*1), which have been already in -mm queue. This problem doesn't happen on original 2.6.26-rc2-mm1. It happens when trying to migrate pages(I used memory_migrate of cpuset). How to reproduce: I tested on fake numa on x86_64 hvm guest of xen(4cpus, 2nodes 1GB/node). - mount cgroups and set parameters # mount -t cgroup -o memory memory /cgroup/memory # mkdir /cgroup/memory/01 # echo 32M >/cgroup/memory/01/memory.limit_in_bytes # mount -t cgroup -o cpuset cpuset /cgroup/cpuset # mkdir /cgroup/cpuset/01 # echo 0-1 >/cgroup/cpuset/01/cpuset.cpus # echo 0 >/cgroup/cpuset/01/cpuset.mems # echo 1 >/cgroup/cpuset/01/cpuset.memory_migrate # mkdir /cgroup/cpuset/02 # echo 2-3 >/cgroup/cpuset/02/cpuset.cpus # echo 1 >/cgroup/cpuset/02/cpuset.mems # echo 1 >/cgroup/cpuset/02/cpuset.memory_migrate - echo pid # echo $$ >/cgroup/memory/01/tasks # echo $$ >/cgroup/cpuset/01/tasks - run program I used "page01" of LTP. # while true; do ./testcases/bin/page01 4718592 1; done & This allocate 18M memory, write to it, read from it, and exit. This problem seems to happen easily when using enough memory to cause some swap in/out. - trigger memory migration Run a easy script(on top cgroup) to echo pids in /cgroup/cpuset/01/tasks to /cgroup/cpuset/02/tasks, and vice versa for several times. Log: Many and many bad page logs like below are displayed in syslog. --- Bad page state in process 'switch.sh' page:ffffe20001f89300 flags:0x050000000000000c mapping:0000000000000000 mapcount:0 count:0 cgroup:ffff8100314c6528 Trying to fix it up, but a reboot is needed Backtrace: Pid: 5542, comm: switch.sh Tainted: G B 2.6.26-rc2-mm1-kame #2 Call Trace: [] bad_page+0x97/0x131 [] free_hot_cold_page+0x9f/0x156 [] __pagevec_free+0x21/0x2e [] release_pages+0x165/0x177 [] remove_migration_ptes+0x4b/0xf0 [] __pagevec_lru_add+0xbf/0xcf [] migrate_pages+0x326/0x465 [] new_node_page+0x0/0x5e [] do_migrate_pages+0x19b/0x1e7 [] set_cpus_allowed_ptr+0xe6/0xf3 [] __link_path_walk+0x13b/0xd02 [] cpuset_migrate_mm+0x58/0x90 [] cpuset_attach+0x8b/0x9e [] sscanf+0x49/0x51 [] cgroup_attach_task+0x3a3/0x3f5 [] cgroup_common_file_write+0x150/0x1dc [] cgroup_file_write+0x54/0x150 [] vfs_write+0xad/0x136 [] sys_write+0x45/0x6e [] tracesys+0xd5/0xda --- All the logs I've seen include the line "cgroup:*******", so it seems that page->page_cgroup is not cleared. Do you have any ideas? Thanks, Daisuke Nishimura. *1 http://lkml.org/lkml/2008/5/15/73 http://lkml.org/lkml/2008/5/20/30 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org