linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Cc: "Dave Jones" <davej@redhat.com>, "Greg KH" <greg@kroah.com>,
	"Akinobu Mita" <akinobu.mita@gmail.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-mm@kvack.org, "Paul Mackerras" <paulus@samba.org>,
	"Pavel Machek" <pavel@ucw.cz>,
	"Américo Wang" <xiyou.wangcong@gmail.com>,
	linux-pm@lists.linux-foundation.org,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH -v5 0/6] notifier error injection
Date: Sat, 30 Jun 2012 14:59:24 +0900	[thread overview]
Message-ID: <1341035970-20490-1-git-send-email-akinobu.mita@gmail.com> (raw)

This provides kernel modules that can be used to test the error handling
of notifier call chain failures by injecting artifical errors to the
following notifier chain callbacks.

 * CPU notifier
 * PM notifier
 * memory hotplug notifier
 * powerpc pSeries reconfig notifier

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

This also adds cpu and memory hotplug tests to tools/testing/selftests 
These tests first do simple online and offline test and then do fault
injection tests if notifier error injection module is available.

Changelog:

* v5 (change only testing scripts)
- make testing scripts a part of tools/testing/selftests
- do simple on/offline tests even if no notifier error injection support

* v4 (It is about 11 months since v3)
- prefix all APIs with notifier_err_inject_*
- rearrange debugfs interface
  (e.g. $DEBUGFS/cpu-notifier-error-inject/CPU_DOWN_PREPARE -->
        $DEBUGFS/notifier-error-inject/cpu/actions/CPU_DOWN_PREPARE/error)
- update modules to follow new interface
- add -r option for memory-notifier.sh to specify percent of offlining
  memory blocks

* v3
- rewrite to be kernel modules instead of initializing at late_initcall()s
  (it makes the diffstat look different but most code remains unchanged)
- export err_inject_notifier_block_{init,cleanup} for modules
- export pSeries_reconfig_notifier_{,un}register symbols for a module
- notifier priority can be specified as a module parameter
- add testing scripts in tools/testing/fault-injection

* v2
- "PM: Improve error code of pm_notifier_call_chain()" is now in -next
- "debugfs: add debugfs_create_int" is dropped
- put a comment in err_inject_notifier_block_init()
- only allow valid errno to be injected (-MAX_ERRNO <= errno <= 0)
- improve Kconfig help text
- make CONFIG_PM_NOTIFIER_ERROR_INJECTION visible even if PM_DEBUG is disabled
- make CONFIG_PM_NOTIFIER_ERROR_INJECTION default if PM_DEBUG is enabled

Akinobu Mita (6):
  fault-injection: notifier error injection
  cpu: rewrite cpu-notifier-error-inject module
  PM: PM notifier error injection module
  memory: memory notifier error injection module
  powerpc: pSeries reconfig notifier error injection module
  fault-injection: add selftests for cpu and memory hotplug

 lib/Kconfig.debug                                  |   91 +++++++-
 lib/Makefile                                       |    5 +
 lib/cpu-notifier-error-inject.c                    |   63 +++---
 lib/memory-notifier-error-inject.c                 |   48 ++++
 lib/notifier-error-inject.c                        |  112 ++++++++++
 lib/notifier-error-inject.h                        |   24 ++
 lib/pSeries-reconfig-notifier-error-inject.c       |   51 +++++
 lib/pm-notifier-error-inject.c                     |   49 +++++
 tools/testing/selftests/Makefile                   |    2 +-
 tools/testing/selftests/cpu-hotplug/Makefile       |    6 +
 tools/testing/selftests/cpu-hotplug/on-off-test.sh |  221 +++++++++++++++++++
 tools/testing/selftests/memory-hotplug/Makefile    |    6 +
 .../selftests/memory-hotplug/on-off-test.sh        |  230 ++++++++++++++++++++
 13 files changed, 867 insertions(+), 41 deletions(-)
 create mode 100644 lib/memory-notifier-error-inject.c
 create mode 100644 lib/notifier-error-inject.c
 create mode 100644 lib/notifier-error-inject.h
 create mode 100644 lib/pSeries-reconfig-notifier-error-inject.c
 create mode 100644 lib/pm-notifier-error-inject.c
 create mode 100644 tools/testing/selftests/cpu-hotplug/Makefile
 create mode 100755 tools/testing/selftests/cpu-hotplug/on-off-test.sh
 create mode 100644 tools/testing/selftests/memory-hotplug/Makefile
 create mode 100755 tools/testing/selftests/memory-hotplug/on-off-test.sh

Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-pm@lists.linux-foundation.org
Cc: Greg KH <greg@kroah.com>
Cc: linux-mm@kvack.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Américo Wang <xiyou.wangcong@gmail.com>
Cc: Michael Ellerman <michael@ellerman.id.au>
Cc: Dave Jones <davej@redhat.com>
-- 
1.7.10.4

             reply	other threads:[~2012-06-30  7:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-30  5:59 Akinobu Mita [this message]
2012-06-30  5:59 ` [PATCH -v5 1/6] fault-injection: notifier error injection Akinobu Mita
2012-06-30  5:59 ` [PATCH -v5 5/6] powerpc: pSeries reconfig notifier error injection module Akinobu Mita
2012-06-30  5:59 ` [PATCH -v5 6/6] fault-injection: add selftests for cpu and memory hotplug Akinobu Mita
2012-07-03 20:41 ` [PATCH -v5 0/6] notifier error injection Andrew Morton
2012-07-04 10:07   ` Akinobu Mita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1341035970-20490-1-git-send-email-akinobu.mita@gmail.com \
    --to=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).