linux/Documentation/vm
Andi Kleen 4fd466eb46 HWPOISON: add memory cgroup filter
The hwpoison test suite need to inject hwpoison to a collection of
selected task pages, and must not touch pages not owned by them and
thus kill important system processes such as init. (But it's OK to
mis-hwpoison free/unowned pages as well as shared clean pages.
Mis-hwpoison of shared dirty pages will kill all tasks, so the test
suite will target all or non of such tasks in the first place.)

The memory cgroup serves this purpose well. We can put the target
processes under the control of a memory cgroup, and tell the hwpoison
injection code to only kill pages associated with some active memory
cgroup.

The prerequisite for doing hwpoison stress tests with mem_cgroup is,
the mem_cgroup code tracks task pages _accurately_ (unless page is
locked).  Which we believe is/should be true.

The benefits are simplification of hwpoison injector code. Also the
mem_cgroup code will automatically be tested by hwpoison test cases.

The alternative interfaces pin-pfn/unpin-pfn can also delegate the
(process and page flags) filtering functions reliably to user space.
However prototype implementation shows that this scheme adds more
complexity than we wanted.

Example test case:

	mkdir /cgroup/hwpoison

	usemem -m 100 -s 1000 &
	echo `jobs -p` > /cgroup/hwpoison/tasks

	memcg_ino=$(ls -id /cgroup/hwpoison | cut -f1 -d' ')
	echo $memcg_ino > /debug/hwpoison/corrupt-filter-memcg

	page-types -p `pidof init`   --hwpoison  # shall do nothing
	page-types -p `pidof usemem` --hwpoison  # poison its pages

[AK: Fix documentation]
[Add fix for problem noticed by Li Zefan <lizf@cn.fujitsu.com>;
dentry in the css could be NULL]

CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Hugh Dickins <hugh.dickins@tiscali.co.uk>
CC: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
CC: Balbir Singh <balbir@linux.vnet.ibm.com>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
CC: Li Zefan <lizf@cn.fujitsu.com>
CC: Paul Menage <menage@google.com>
CC: Nick Piggin <npiggin@suse.de>
CC: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
2009-12-16 12:19:59 +01:00
..
.gitignore Documentation/vm/.gitignore: add page-types 2009-09-24 07:20:57 -07:00
00-INDEX hugetlb: add MAP_HUGETLB example 2009-09-22 07:17:42 -07:00
active_mm.txt mm: add documentation describing what tsk->active_mm means vs tsk->mm 2009-04-13 15:04:32 -07:00
balance page allocator: use allocation flags as an index to the zone watermark 2009-06-16 19:47:35 -07:00
hugetlbpage.txt hugetlb: handle memory hot-plug events 2009-12-15 08:53:13 -08:00
hwpoison.txt HWPOISON: add memory cgroup filter 2009-12-16 12:19:59 +01:00
ksm.txt ksm: remove unswappable max_kernel_pages 2009-12-15 08:53:20 -08:00
locking truncate: new helpers 2009-09-24 08:41:47 -04:00
Makefile Documentation/vm/Makefile: don't try to build slqbinfo 2009-06-17 09:45:46 -07:00
map_hugetlb.c hugetlb: add MAP_HUGETLB example 2009-09-22 07:17:42 -07:00
numa Documentation: remove duplicated words 2006-10-03 22:57:56 +02:00
numa_memory_policy.txt trivial: fix where cgroup documentation is not correctly referred to 2009-03-30 15:22:02 +02:00
overcommit-accounting Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
page_migration trivial: fix where cgroup documentation is not correctly referred to 2009-03-30 15:22:02 +02:00
page-types.c page-types: add standard GPL license header 2009-12-16 12:19:57 +01:00
pagemap.txt pagemap: document KPF_KSM and show it in page-types 2009-10-08 07:36:39 -07:00
slabinfo.c Documentation/: fix warnings from -Wmissing-prototypes in HOSTCFLAGS 2009-09-23 07:39:28 -07:00
slub.txt doc: Fix a typo in slub.txt. 2009-12-04 15:39:59 +01:00
unevictable-lru.txt mm: reformat the Unevictable-LRU documentation 2009-04-13 15:04:31 -07:00