Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>; dentry in the css could be NULL] CC: KOSAKI Motohiro <[email protected]> CC: Hugh Dickins <[email protected]> CC: Daisuke Nishimura <[email protected]> CC: Balbir Singh <[email protected]> CC: KAMEZAWA Hiroyuki <[email protected]> CC: Li Zefan <[email protected]> CC: Paul Menage <[email protected]> CC: Nick Piggin <[email protected]> CC: Andi Kleen <[email protected]> Signed-off-by: Wu Fengguang <[email protected]> Signed-off-by: Andi Kleen <[email protected]>
- Loading branch information