linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -mm 1/3] notifier error injection: fix copy-and-paste error in Kconfig help
@ 2012-07-08  0:24 Akinobu Mita
  2012-07-08  0:24 ` [PATCH -mm 2/3] notifier error injection documentation Akinobu Mita
  2012-07-08  0:24 ` [PATCH -mm 3/3] fault-injection: mention failcmd.sh tool in document Akinobu Mita
  0 siblings, 2 replies; 4+ messages in thread
From: Akinobu Mita @ 2012-07-08  0:24 UTC (permalink / raw)
  To: linux-kernel, akpm; +Cc: Akinobu Mita, Benjamin Herrenschmidt, Paul Mackerras

powerpc-pseries-reconfig-notifier-error-injection-module.patch
in -mm tree has a copy-and-paste error in Kconfig help.

The module name should be pSeries-reconfig-notifier-error-inject.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
---
 lib/Kconfig.debug |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 8f8e226..1b77bc7 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1179,7 +1179,7 @@ config PSERIES_RECONFIG_NOTIFIER_ERROR_INJECT
 	  notified, write the error code to "actions/<notifier event>/error".
 
 	  To compile this code as a module, choose M here: the module will
-	  be called memory-notifier-error-inject.
+	  be called pSeries-reconfig-notifier-error-inject.
 
 	  If unsure, say N.
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH -mm 2/3] notifier error injection documentation
  2012-07-08  0:24 [PATCH -mm 1/3] notifier error injection: fix copy-and-paste error in Kconfig help Akinobu Mita
@ 2012-07-08  0:24 ` Akinobu Mita
  2012-07-08 15:03   ` Rafael J. Wysocki
  2012-07-08  0:24 ` [PATCH -mm 3/3] fault-injection: mention failcmd.sh tool in document Akinobu Mita
  1 sibling, 1 reply; 4+ messages in thread
From: Akinobu Mita @ 2012-07-08  0:24 UTC (permalink / raw)
  To: linux-kernel, akpm
  Cc: Akinobu Mita, Pavel Machek, Rafael J. Wysocki, Greg KH,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Dave Jones

fault-injection-notifier-error-injection.patch in -mm tree adds
notifier error injection.

This adds Documentation/fault-injection/notifier-error-inject.txt
which describes its feature and usage examples.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Greg KH <greg@kroah.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <michael@ellerman.id.au>
Cc: Dave Jones <davej@redhat.com>
---
 .../fault-injection/notifier-error-inject.txt      |   99 ++++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 Documentation/fault-injection/notifier-error-inject.txt

diff --git a/Documentation/fault-injection/notifier-error-inject.txt b/Documentation/fault-injection/notifier-error-inject.txt
new file mode 100644
index 0000000..c83526c
--- /dev/null
+++ b/Documentation/fault-injection/notifier-error-inject.txt
@@ -0,0 +1,99 @@
+Notifier error injection
+========================
+
+Notifier error injection provides the ability to inject artifical errors to
+specified notifier chain callbacks. It is useful to test the error handling of
+notifier call chain failures which is rarely executed.  There are kernel
+modules that can be used to test the following notifiers.
+
+ * CPU notifier
+ * PM notifier
+ * Memory hotplug notifier
+ * powerpc pSeries reconfig notifier
+
+CPU notifier error injection module
+-----------------------------------
+This feature can be used to test the error handling of the CPU notifiers by
+injecting artifical errors to CPU notifier chain callbacks.
+
+If the notifier call chain should be failed with some events notified, write
+the error code to debugfs interface
+/sys/kernel/debug/notifier-error-inject/cpu/actions/<notifier event>/error
+
+Possible CPU notifier events to be failed are:
+
+ * CPU_UP_PREPARE
+ * CPU_UP_PREPARE_FROZEN
+ * CPU_DOWN_PREPARE
+ * CPU_DOWN_PREPARE_FROZEN
+
+Example1: Inject CPU offline error (-1 == -EPERM)
+
+	# cd /sys/kernel/debug/notifier-error-inject/cpu
+	# echo -1 > actions/CPU_DOWN_PREPARE/error
+	# echo 0 > /sys/devices/system/cpu/cpu1/online
+	bash: echo: write error: Operation not permitted
+
+Example2: inject CPU online error (-2 == -ENOENT)
+
+	# echo -2 > actions/CPU_UP_PREPARE/error
+	# echo 1 > /sys/devices/system/cpu/cpu1/online
+	bash: echo: write error: No such file or directory
+
+PM notifier error injection module
+----------------------------------
+This feature is controlled through debugfs interface
+/sys/kernel/debug/notifier-error-inject/pm/actions/<notifier event>/error
+
+Possible PM notifier events to be failed are:
+
+ * PM_HIBERNATION_PREPARE
+ * PM_SUSPEND_PREPARE
+ * PM_RESTORE_PREPARE
+
+Example: Inject PM suspend error (-12 = -ENOMEM)
+
+	# cd /sys/kernel/debug/notifier-error-inject/pm/
+	# echo -12 > actions/PM_SUSPEND_PREPARE/error
+	# echo mem > /sys/power/state
+	bash: echo: write error: Cannot allocate memory
+
+Memory hotplug notifier error injection module
+----------------------------------------------
+This feature is controlled through debugfs interface
+/sys/kernel/debug/notifier-error-inject/memory/actions/<notifier event>/error
+
+Possible memory notifier events to be failed are:
+
+ * MEM_GOING_ONLINE
+ * MEM_GOING_OFFLINE
+
+Example: Inject memory hotplug offline error (-12 == -ENOMEM)
+
+	# cd /sys/kernel/debug/notifier-error-inject/memory
+	# echo -12 > actions/MEM_GOING_OFFLINE/error
+	# echo offline > /sys/devices/system/memory/memoryXXX/state
+	bash: echo: write error: Cannot allocate memory
+
+powerpc pSeries reconfig notifier error injection module
+--------------------------------------------------------
+This feature is controlled through debugfs interface
+/sys/kernel/debug/notifier-error-inject/pSeries-reconfig/actions/<notifier event>/error
+
+Possible pSeries reconfig notifier events to be failed are:
+
+ * PSERIES_RECONFIG_ADD
+ * PSERIES_RECONFIG_REMOVE
+ * PSERIES_DRCONF_MEM_ADD
+ * PSERIES_DRCONF_MEM_REMOVE
+
+For more usage examples
+-----------------------
+There are tools/testing/selftests using the notifier error injection features
+for CPU and memory notifiers.
+
+ * tools/testing/selftests/cpu-hotplug/on-off-test.sh
+ * tools/testing/selftests/memory-hotplug/on-off-test.sh
+
+These scripts first do simple online and offline tests and then do fault
+injection tests if notifier error injection module is available.
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH -mm 3/3] fault-injection: mention failcmd.sh tool in document
  2012-07-08  0:24 [PATCH -mm 1/3] notifier error injection: fix copy-and-paste error in Kconfig help Akinobu Mita
  2012-07-08  0:24 ` [PATCH -mm 2/3] notifier error injection documentation Akinobu Mita
@ 2012-07-08  0:24 ` Akinobu Mita
  1 sibling, 0 replies; 4+ messages in thread
From: Akinobu Mita @ 2012-07-08  0:24 UTC (permalink / raw)
  To: linux-kernel, akpm; +Cc: Akinobu Mita

fault-injection-add-tool-to-run-command-with-failslab-or-fail_page_alloc.patch
in -mm tree adds tools/testing/fault-injection/failcmd.sh to make it
easier to inject slab/page allocation failures by fault injection.

This adds the introduction to
Documentation/fault-injection/fault-injection.txt.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 Documentation/fault-injection/fault-injection.txt |   27 +++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt
index dc77948..832fc4f 100644
--- a/Documentation/fault-injection/fault-injection.txt
+++ b/Documentation/fault-injection/fault-injection.txt
@@ -241,3 +241,30 @@ trap "echo 0 > /sys/kernel/debug/$FAILTYPE/probability" SIGINT SIGTERM EXIT
 echo "Injecting errors into the module $module... (interrupt to stop)"
 sleep 1000000
 
+Tool to run command with failslab or fail_page_alloc
+----------------------------------------------------
+In order to make it easier to accomplish the tasks mentioned above, we can use
+tools/testing/fault-injection/failcmd.sh.  Please run a command
+"./tools/testing/fault-injection/failcmd.sh --help" for more information and
+see the following examples.
+
+Examples:
+
+Run a command "make -C tools/testing/selftests/ run_tests" with injecting slab
+allocation failure.
+
+	# ./tools/testing/fault-injection/failcmd.sh \
+		-- make -C tools/testing/selftests/ run_tests
+
+Same as above except to specify 100 times failures at most instead of one time
+at most by default.
+
+	# ./tools/testing/fault-injection/failcmd.sh --times=100 \
+		-- make -C tools/testing/selftests/ run_tests
+
+Same as above except to inject page allocation failure instead of slab
+allocation failure.
+
+	# env FAILCMD_TYPE=fail_page_alloc \
+		./tools/testing/fault-injection/failcmd.sh --times=100 \
+                -- make -C tools/testing/selftests/ run_tests
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -mm 2/3] notifier error injection documentation
  2012-07-08  0:24 ` [PATCH -mm 2/3] notifier error injection documentation Akinobu Mita
@ 2012-07-08 15:03   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2012-07-08 15:03 UTC (permalink / raw)
  To: Akinobu Mita
  Cc: linux-kernel, akpm, Pavel Machek, Greg KH,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Dave Jones

On Sunday, July 08, 2012, Akinobu Mita wrote:
> fault-injection-notifier-error-injection.patch in -mm tree adds
> notifier error injection.
> 
> This adds Documentation/fault-injection/notifier-error-inject.txt
> which describes its feature and usage examples.
> 
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: Greg KH <greg@kroah.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <michael@ellerman.id.au>
> Cc: Dave Jones <davej@redhat.com>

ACK for the PM part.

Thanks,
Rafael


> ---
>  .../fault-injection/notifier-error-inject.txt      |   99 ++++++++++++++++++++
>  1 file changed, 99 insertions(+)
>  create mode 100644 Documentation/fault-injection/notifier-error-inject.txt
> 
> diff --git a/Documentation/fault-injection/notifier-error-inject.txt b/Documentation/fault-injection/notifier-error-inject.txt
> new file mode 100644
> index 0000000..c83526c
> --- /dev/null
> +++ b/Documentation/fault-injection/notifier-error-inject.txt
> @@ -0,0 +1,99 @@
> +Notifier error injection
> +========================
> +
> +Notifier error injection provides the ability to inject artifical errors to
> +specified notifier chain callbacks. It is useful to test the error handling of
> +notifier call chain failures which is rarely executed.  There are kernel
> +modules that can be used to test the following notifiers.
> +
> + * CPU notifier
> + * PM notifier
> + * Memory hotplug notifier
> + * powerpc pSeries reconfig notifier
> +
> +CPU notifier error injection module
> +-----------------------------------
> +This feature can be used to test the error handling of the CPU notifiers by
> +injecting artifical errors to CPU notifier chain callbacks.
> +
> +If the notifier call chain should be failed with some events notified, write
> +the error code to debugfs interface
> +/sys/kernel/debug/notifier-error-inject/cpu/actions/<notifier event>/error
> +
> +Possible CPU notifier events to be failed are:
> +
> + * CPU_UP_PREPARE
> + * CPU_UP_PREPARE_FROZEN
> + * CPU_DOWN_PREPARE
> + * CPU_DOWN_PREPARE_FROZEN
> +
> +Example1: Inject CPU offline error (-1 == -EPERM)
> +
> +	# cd /sys/kernel/debug/notifier-error-inject/cpu
> +	# echo -1 > actions/CPU_DOWN_PREPARE/error
> +	# echo 0 > /sys/devices/system/cpu/cpu1/online
> +	bash: echo: write error: Operation not permitted
> +
> +Example2: inject CPU online error (-2 == -ENOENT)
> +
> +	# echo -2 > actions/CPU_UP_PREPARE/error
> +	# echo 1 > /sys/devices/system/cpu/cpu1/online
> +	bash: echo: write error: No such file or directory
> +
> +PM notifier error injection module
> +----------------------------------
> +This feature is controlled through debugfs interface
> +/sys/kernel/debug/notifier-error-inject/pm/actions/<notifier event>/error
> +
> +Possible PM notifier events to be failed are:
> +
> + * PM_HIBERNATION_PREPARE
> + * PM_SUSPEND_PREPARE
> + * PM_RESTORE_PREPARE
> +
> +Example: Inject PM suspend error (-12 = -ENOMEM)
> +
> +	# cd /sys/kernel/debug/notifier-error-inject/pm/
> +	# echo -12 > actions/PM_SUSPEND_PREPARE/error
> +	# echo mem > /sys/power/state
> +	bash: echo: write error: Cannot allocate memory
> +
> +Memory hotplug notifier error injection module
> +----------------------------------------------
> +This feature is controlled through debugfs interface
> +/sys/kernel/debug/notifier-error-inject/memory/actions/<notifier event>/error
> +
> +Possible memory notifier events to be failed are:
> +
> + * MEM_GOING_ONLINE
> + * MEM_GOING_OFFLINE
> +
> +Example: Inject memory hotplug offline error (-12 == -ENOMEM)
> +
> +	# cd /sys/kernel/debug/notifier-error-inject/memory
> +	# echo -12 > actions/MEM_GOING_OFFLINE/error
> +	# echo offline > /sys/devices/system/memory/memoryXXX/state
> +	bash: echo: write error: Cannot allocate memory
> +
> +powerpc pSeries reconfig notifier error injection module
> +--------------------------------------------------------
> +This feature is controlled through debugfs interface
> +/sys/kernel/debug/notifier-error-inject/pSeries-reconfig/actions/<notifier event>/error
> +
> +Possible pSeries reconfig notifier events to be failed are:
> +
> + * PSERIES_RECONFIG_ADD
> + * PSERIES_RECONFIG_REMOVE
> + * PSERIES_DRCONF_MEM_ADD
> + * PSERIES_DRCONF_MEM_REMOVE
> +
> +For more usage examples
> +-----------------------
> +There are tools/testing/selftests using the notifier error injection features
> +for CPU and memory notifiers.
> +
> + * tools/testing/selftests/cpu-hotplug/on-off-test.sh
> + * tools/testing/selftests/memory-hotplug/on-off-test.sh
> +
> +These scripts first do simple online and offline tests and then do fault
> +injection tests if notifier error injection module is available.
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-08 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-08  0:24 [PATCH -mm 1/3] notifier error injection: fix copy-and-paste error in Kconfig help Akinobu Mita
2012-07-08  0:24 ` [PATCH -mm 2/3] notifier error injection documentation Akinobu Mita
2012-07-08 15:03   ` Rafael J. Wysocki
2012-07-08  0:24 ` [PATCH -mm 3/3] fault-injection: mention failcmd.sh tool in document Akinobu Mita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).