|
|
Log in / Subscribe / Register

memcg: add support for hwpoison testing

From:  Wu Fengguang <fengguang.wu@intel.com>
To:  Balbir Singh <balbir@linux.vnet.ibm.com>
Subject:  [RFC][PATCH 0/4] memcg: add support for hwpoison testing
Date:  Mon, 31 Aug 2009 18:26:40 +0800
Message-ID:  <20090831102640.092092954@intel.com>
Cc:  Andi Kleen <andi@firstfloor.org>
Archive‑link:  Article

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
-- 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds