Skip to content

RFC memcg: add support for hwpoison testing

Wu Fengguang linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4memcg: show memory.id in cgroupfsmm/memcontrol.c+9 -00 replies
2/4memcg: rename and export try_get_mem_cgroup_from_page()include/linux/memcontrol.h mm/memcontrol.c+11 -70 replies
3/4memcg: add accessor to mem_cgroup.cssinclude/linux/memcontrol.h mm/memcontrol.c+13 -00 replies
4/4HWPOISON: memory cgroup based hwpoison injection filteringmm/hwpoison-inject.c+37 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/4] memcg: add support for hwpoison testing

Hi all,

In hardware poison testing, we want to inject hwpoison errors to pages of a collection of selected tasks, so that random tasks (eg. init) won't be killed in stress tests and lead to test failure.

Memory cgroup provides an ideal tool for tracking and testing these target process pages. All we have to do is to
- export the memory cgroup id via cgroupfs
- export two functions/structs for hwpoison_inject.c

This might be an unexpected usage of memory cgroup. The last patch and this script demonstrates how the exported interfaces are to be used to limit the scope of hwpoison injection.

	test -d /cgroup/hwpoison && rmdir /cgroup/hwpoison
	mkdir /cgroup/hwpoison

	usemem -m 100 -s 100 &   # eat 100MB and sleep 100s
	echo `pidof usemem` > /cgroup/hwpoison/tasks

==> memcg_id=$(</cgroup/hwpoison/memory.id)
==> echo $memcg_id > /debug/hwpoison/corrupt-filter-memcg

	# hwpoison all pfn
	pfn=0
	while true
	do      
		let pfn=pfn+1
		echo $pfn > /debug/hwpoison/corrupt-pfn
		if [ $? -ne 0 ]; then
			break
		fi
	done

Comments are welcome, thanks!

Cheers,
Fengguang

Signature · 5 lines
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>