path: root/Documentation/fault-injection
AgeCommit message (Collapse)Author
2020-10-23Merge tag 'docs-5.10-2' of git:// Torvalds
Pull documentation fixes from Jonathan Corbet: "A handful of late-arriving documentation fixes" * tag 'docs-5.10-2' of git:// docs: Add two missing entries in vm sysctl index docs/vm: trivial fixes to several spelling mistakes docs: submitting-patches: describe preserving review/test tags Documentation: Chinese translation of Documentation/arm64/hugetlbpage.rst Documentation: x86: fix a missing word in x86_64/mm.rst. docs: driver-api: remove a duplicated index entry docs: lkdtm: Modernize and improve details docs: deprecated.rst: Expand str*cpy() replacement notes docs/cpu-load: format the example code.
2020-10-21docs: lkdtm: Modernize and improve detailsKees Cook
The details on using LKDTM were overly obscure. Modernize the details and expand examples to better illustrate how to use the interfaces. Additionally add missing SPDX header. Signed-off-by: Kees Cook <> Link: Signed-off-by: Jonathan Corbet <>
2020-10-16lib, include/linux: add usercopy failure capabilityAlbert van der Linde
Patch series "add fault injection to user memory access", v3. The goal of this series is to improve testing of fault-tolerance in usages of user memory access functions, by adding support for fault injection. syzkaller/syzbot are using the existing fault injection modes and will use this particular feature also. The first patch adds failure injection capability for usercopy functions. The second changes usercopy functions to use this new failure capability (copy_from_user, ...). The third patch adds get/put/clear_user failures to x86. This patch (of 3): Add a failure injection capability to improve testing of fault-tolerance in usages of user memory access functions. Add CONFIG_FAULT_INJECTION_USERCOPY to enable faults in usercopy functions. The should_fail_usercopy function is to be called by these functions (copy_from_user, get_user, ...) in order to fail or not. Signed-off-by: Albert van der Linde <> Signed-off-by: Andrew Morton <> Reviewed-by: Akinobu Mita <> Reviewed-by: Alexander Potapenko <> Cc: Borislav Petkov <> Cc: Ingo Molnar <> Cc: Jonathan Corbet <> Cc: Thomas Gleixner <> Cc: Arnd Bergmann <> Cc: Peter Zijlstra (Intel) <> Cc: "H. Peter Anvin" <> Cc: Al Viro <> Cc: Andrey Konovalov <> Cc: Dmitry Vyukov <> Cc: Marco Elver <> Cc: Christoph Hellwig <> Link: Link: Signed-off-by: Linus Torvalds <>
2020-08-21nvme: rename and document nvme_end_requestChristoph Hellwig
nvme_end_request is a bit misnamed, as it wraps around the blk_mq_complete_* API. It's semantics also are non-trivial, so give it a more descriptive name and add a comment explaining the semantics. Signed-off-by: Christoph Hellwig <> Reviewed-by: Sagi Grimberg <> Reviewed-by: Mike Snitzer <> Signed-off-by: Sagi Grimberg <> Signed-off-by: Jens Axboe <>
2020-07-01block: rename generic_make_request to submit_bio_noacctChristoph Hellwig
generic_make_request has always been very confusingly misnamed, so rename it to submit_bio_noacct to make it clear that it is submit_bio minus accounting and a few checks. Signed-off-by: Christoph Hellwig <> Signed-off-by: Jens Axboe <>
2019-07-15docs: add some directories to the main documentation indexMauro Carvalho Chehab
The contents of those directories were orphaned at the documentation body. While those directories could likely be moved to be inside some guide, I'm opting to just adding their indexes to the main one, removing the :orphan: and adding the SPDX header. For the drivers, the rationale is that the documentation contains a mix of Kernelspace, uAPI and admin-guide. So, better to keep them on separate directories, as we've be doing with similar subsystem-specific docs that were not split yet. For the others, well... I'm too lazy to do the move. Also, it seems to make sense to keep at least some of those at the main dir (like kbuild, for example). In any case, a latter patch could do the move. Signed-off-by: Mauro Carvalho Chehab <> Acked-by: Bartlomiej Zolnierkiewicz <>
2019-07-09Merge tag 'docs-5.3' of git:// Torvalds
Pull Documentation updates from Jonathan Corbet: "It's been a relatively busy cycle for docs: - A fair pile of RST conversions, many from Mauro. These create more than the usual number of simple but annoying merge conflicts with other trees, unfortunately. He has a lot more of these waiting on the wings that, I think, will go to you directly later on. - A new document on how to use merges and rebases in kernel repos, and one on Spectre vulnerabilities. - Various improvements to the build system, including automatic markup of function() references because some people, for reasons I will never understand, were of the opinion that :c:func:``function()`` is unattractive and not fun to type. - We now recommend using sphinx 1.7, but still support back to 1.4. - Lots of smaller improvements, warning fixes, typo fixes, etc" * tag 'docs-5.3' of git:// (129 commits) docs: ignore exceptions when seeking for xrefs docs: Move binderfs to admin-guide Disable Sphinx SmartyPants in HTML output doc: RCU callback locks need only _bh, not necessarily _irq docs: format kernel-parameters -- as code Doc : doc-guide : Fix a typo platform: x86: get rid of a non-existent document Add the RCU docs to the core-api manual Documentation: RCU: Add TOC tree hooks Documentation: RCU: Rename txt files to rst Documentation: RCU: Convert RCU UP systems to reST Documentation: RCU: Convert RCU linked list to reST Documentation: RCU: Convert RCU basic concepts to reST docs: filesystems: Remove uneeded .rst extension on toctables scripts/sphinx-pre-install: fix out-of-tree build docs: zh_CN: submitting-drivers.rst: Remove a duplicated Documentation/ Documentation: PGP: update for newer HW devices Documentation: Add section about CPU vulnerabilities for Spectre Documentation: platform: Delete x86-laptop-drivers.txt docs: Note that :c:func: should no longer be used ...
2019-06-21Documentation: nvme: add an example for nvme fault injectionAkinobu Mita
This adds an example of how to inject errors into admin commands. Suggested-by: Thomas Tai <> Signed-off-by: Akinobu Mita <> Reviewed-by: Chaitanya Kulkarni <> Reviewed-by: Minwoo Im <> Reviewed-by: Christoph Hellwig <> Signed-off-by: Christoph Hellwig <>
2019-06-14docs: fault-injection: convert docs to ReST and rename to *.rstMauro Carvalho Chehab
The conversion is actually: - add blank lines and identation in order to identify paragraphs; - fix tables markups; - add some lists markups; - mark literal blocks; - adjust title markups. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab <> Acked-by: Federico Vaga <> Signed-off-by: Jonathan Corbet <>
2019-01-07doc: fault-injection: fix macro name in exampleLaurent Gauthier
Signed-off-by: Laurent Gauthier <> Signed-off-by: Jonathan Corbet <>
2018-03-26Documentation: nvme: Documentation for nvme fault injectionThomas Tai
Add examples to show how to use nvme fault injection. Signed-off-by: Thomas Tai <> Reviewed-by: Eric Saint-Etienne <> Signed-off-by: Karl Volz <> Reviewed-by: Keith Busch <> Signed-off-by: Sagi Grimberg <> Signed-off-by: Jens Axboe <>
2018-01-31Merge tag 'docs-4.16' of git:// Torvalds
Pull documentation updates from Jonathan Corbet: "Documentation updates for 4.16. New stuff includes refcount_t documentation, errseq documentation, kernel-doc support for nested structure definitions, the removal of lots of crufty kernel-doc support for unused formats, SPDX tag documentation, the beginnings of a manual for subsystem maintainers, and lots of fixes and updates. As usual, some of the changesets reach outside of Documentation/ to effect kerneldoc comment fixes. It also adds the new LICENSES directory, of which Thomas promises I do not need to be the maintainer" * tag 'docs-4.16' of git:// (65 commits) linux-next: docs-rst: Fix typos in linux-next: DOC: HWPOISON: Fix path to debugfs in hwpoison.txt Documentation: Fix misconversion of #if docs: add index entry for networking/msg_zerocopy Documentation: security/credentials.rst: explain need to sort group_list LICENSES: Add MPL-1.1 license LICENSES: Add the GPL 1.0 license LICENSES: Add Linux syscall note exception LICENSES: Add the MIT license LICENSES: Add the BSD-3-clause "Clear" license LICENSES: Add the BSD 3-clause "New" or "Revised" License LICENSES: Add the BSD 2-clause "Simplified" license LICENSES: Add the LGPL-2.1 license LICENSES: Add the LGPL 2.0 license LICENSES: Add the GPL 2.0 license Documentation: Add license-rules.rst to describe how to properly identify file licenses scripts: kernel_doc: better handle show warnings logic fs/*/Kconfig: drop links to 404-compliant doc: md: Fix a file name to md-fault.c in fault-injection.txt errseq: Add to documentation tree ...
2018-01-12error-injection: Support fault injection frameworkMasami Hiramatsu
Support in-kernel fault-injection framework via debugfs. This allows you to inject a conditional error to specified function using debugfs interfaces. Here is the result of test script described in Documentation/fault-injection/fault-injection.txt =========== # ./ 1+0 records in 1+0 records out 1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0227404 s, 46.1 MB/s btrfs-progs v4.4 See for more information. Label: (null) UUID: bfa96010-12e9-4360-aed0-42eec7af5798 Node size: 16384 Sector size: 4096 Filesystem size: 1001.00MiB Block group profiles: Data: single 8.00MiB Metadata: DUP 58.00MiB System: DUP 12.00MiB SSD detected: no Incompat features: extref, skinny-metadata Number of devices: 1 Devices: ID SIZE PATH 1 1001.00MiB /dev/loop2 mount: mount /dev/loop2 on /opt/tmpmnt failed: Cannot allocate memory SUCCESS! =========== Signed-off-by: Masami Hiramatsu <> Reviewed-by: Josef Bacik <> Signed-off-by: Alexei Starovoitov <>
2018-01-01doc: md: Fix a file name to md-fault.c in fault-injection.txtMasanari Iida
drivers/md/faulty.c has been renamed to md-faulty.c after following commit merged int to the main line. 935fe0983e09f4f7331ebf5ea4ae2124f6e9f9e8 . But the file name in fault-injection.txt has not been changed. Now the actual file name and document are in sync. Signed-off-by: Masanari Iida <> Signed-off-by: Jonathan Corbet <>
2017-11-13cpu/hotplug: Get rid of CPU hotplug notifier leftoversThomas Gleixner
The CPU hotplug notifiers are history. Remove the last reminders. Reported-by: Ingo Molnar <> Signed-off-by: Thomas Gleixner <>
2017-07-14fault-inject: add /proc/<pid>/fail-nthAkinobu Mita
fail-nth interface is only created in /proc/self/task/<current-tid>/. This change also adds it in /proc/<pid>/. This makes shell based tool a bit simpler. $ bash -c "builtin echo 100 > /proc/self/fail-nth && exec ls /" Link: Signed-off-by: Akinobu Mita <> Cc: Dmitry Vyukov <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2017-07-14fault-inject: make fail-nth read/write interface symmetricAkinobu Mita
The read interface for fail-nth looks a bit odd. Read from this file returns "NYYYY..." or "YYYYY..." (this makes me surprise when cat this file). Because there is no EOF condition. The first character indicates current->fail_nth is zero or not, and then current->fail_nth is reset to zero. Just returning task->fail_nth value is more natural to understand. Link: Signed-off-by: Akinobu Mita <> Cc: Dmitry Vyukov <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2017-07-14fault-inject: parse as natural 1-based value for fail-nth write interfaceAkinobu Mita
The value written to fail-nth file is parsed as 0-based. Parsing as one-based is more natural to understand and it enables to cancel the previous setup by simply writing '0'. This change also converts task->fail_nth from signed to unsigned int. Link: Signed-off-by: Akinobu Mita <> Cc: Dmitry Vyukov <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2017-07-12fault-inject: support systematic fault injectionDmitry Vyukov
Add /proc/self/task/<current-tid>/fail-nth file that allows failing 0-th, 1-st, 2-nd and so on calls systematically. Excerpt from the added documentation: "Write to this file of integer N makes N-th call in the current task fail (N is 0-based). Read from this file returns a single char 'Y' or 'N' that says if the fault setup with a previous write to this file was injected or not, and disables the fault if it wasn't yet injected. Note that this file enables all types of faults (slab, futex, etc). This setting takes precedence over all other generic settings like probability, interval, times, etc. But per-capability settings (e.g. fail_futex/ignore-private) take precedence over it. This feature is intended for systematic testing of faults in a single system call. See an example below" Why add a new setting: 1. Existing settings are global rather than per-task. So parallel testing is not possible. 2. attr->interval is close but it depends on attr->count which is non reset to 0, so interval does not work as expected. 3. Trying to model this with existing settings requires manipulations of all of probability, interval, times, space, task-filter and unexposed count and per-task make-it-fail files. 4. Existing settings are per-failure-type, and the set of failure types is potentially expanding. 5. make-it-fail can't be changed by unprivileged user and aggressive stress testing better be done from an unprivileged user. Similarly, this would require opening the debugfs files to the unprivileged user, as he would need to reopen at least times file (not possible to pre-open before dropping privs). The proposed interface solves all of the above (see the example). We want to integrate this into syzkaller fuzzer. A prototype has found 10 bugs in kernel in first day of usage:!searchin/syzkaller/%22FAULT_INJECTION%22%7Csort:relevance I've made the current interface work with all types of our sandboxes. For setuid the secret sauce was prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) to make /proc entries non-root owned. So I am fine with the current version of the code. [ fix build] Link: Signed-off-by: Dmitry Vyukov <> Cc: Akinobu Mita <> Cc: Michal Hocko <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2015-12-03net: Add support for CHANGEUPPER notifier error injectionIdo Schimmel
Since CHANGEUPPER can now fail, add support for it in the newly introduced netdev notifier error injection infrastructure. Signed-off-by: Ido Schimmel <> Signed-off-by: Jiri Pirko <> Acked-by: Nikolay Aleksandrov <> Signed-off-by: David S. Miller <>
2015-12-01net: add support for netdev notifier error injectionNikolay Aleksandrov
This module allows to insert errors in some of netdevice's notifier events. All network drivers use these notifiers to signal various events and to check if they are allowed, e.g. PRECHANGEMTU and CHANGEMTU afterwards. Until recently I had to run failure tests by injecting a custom module, but now this infrastructure makes it trivial to test these failure paths. Some of the recent bugs I fixed were found using this module. Here's an example: $ cd /sys/kernel/debug/notifier-error-inject/netdev $ echo -22 > actions/NETDEV_CHANGEMTU/error $ ip link set eth0 mtu 1024 RTNETLINK answers: Invalid argument CC: Akinobu Mita <> CC: "David S. Miller" <> CC: netdev <> Signed-off-by: Nikolay Aleksandrov <> Signed-off-by: David S. Miller <>
2015-07-20futex: Fault/error injection capabilitiesDavidlohr Bueso
Although futexes are well known for being a royal pita, we really have very little debugging capabilities - except for relying on tglx's eye half the time. By simply making use of the existing fault-injection machinery, we can improve this situation, allowing generating artificial uaddress faults and deadlock scenarios. Of course, when this is disabled in production systems, the overhead for failure checks is practically zero -- so this is very cheap at the same time. Future work would be nice to now enhance trinity to make use of this. There is a special tunable 'ignore-private', which can filter out private futexes. Given the tsk->make_it_fail filter and this option, pi futexes can be narrowed down pretty closely. Signed-off-by: Davidlohr Bueso <> Cc: Peter Zijlstra <> Cc: Darren Hart <> Cc: Davidlohr Bueso <> Link: Signed-off-by: Thomas Gleixner <>
2012-11-19doc: fix quite a few typos within DocumentationMasanari Iida
Correct spelling typo in Documentations Signed-off-by: Jiri Kosina <>
2012-07-30fault-injection: add tool to run command with failslab or fail_page_allocAkinobu Mita
This adds tools/testing/fault-injection/ to run a command while injecting slab/page allocation failures via fault injection. Example: Run a command "make -C tools/testing/selftests/ run_tests" with injecting slab allocation failure. # ./tools/testing/fault-injection/ \ -- 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/ --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/ --times=100 \ -- make -C tools/testing/selftests/ run_tests Signed-off-by: Akinobu Mita <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2012-07-30fault-injection: notifier error injectionAkinobu Mita
This patchset 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 The patchset 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. This patch: The 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. This adds common basic functions to define which type of events can be fail and to initialize the debugfs interface to control what error code should be returned and which event should be failed. Signed-off-by: Akinobu Mita <> Cc: Pavel Machek <> Cc: "Rafael J. Wysocki" <> Cc: Greg KH <> Cc: Benjamin Herrenschmidt <> Cc: Paul Mackerras <> Cc: Michael Ellerman <> Cc: Dave Jones <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2011-10-26fault-injection: update documentation with the mmc module paramPer Forlin
Signed-off-by: Per Forlin <> Reviewed-by: Akinobu Mita <> Signed-off-by: Chris Ball <>
2011-10-26fault-inject: add documentation on MMC IO fault injectionPer Forlin
Add description on how to enable random fault injection for MMC IO. Signed-off-by: Per Forlin <> Acked-by: Akinobu Mita <> Reviewed-by: Linus Walleij <> Signed-off-by: Chris Ball <>
2011-08-03fault-injection: add ability to export fault_attr in arbitrary directoryAkinobu Mita
init_fault_attr_dentries() is used to export fault_attr via debugfs. But it can only export it in debugfs root directory. Per Forlin is working on mmc_fail_request which adds support to inject data errors after a completed host transfer in MMC subsystem. The fault_attr for mmc_fail_request should be defined per mmc host and export it in debugfs directory per mmc host like /sys/kernel/debug/mmc0/mmc_fail_request. init_fault_attr_dentries() doesn't help for mmc_fail_request. So this introduces fault_create_debugfs_attr() which is able to create a directory in the arbitrary directory and replace init_fault_attr_dentries(). [ extraneous semicolon, per Randy] Signed-off-by: Akinobu Mita <> Tested-by: Per Forlin <> Cc: Jens Axboe <> Cc: Christoph Lameter <> Cc: Pekka Enberg <> Cc: Matt Mackall <> Cc: Randy Dunlap <> Cc: Stephen Rothwell <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2010-03-06lkdtm: add debugfs access and loosen KPROBE tiesSimon Kagstrom
Add adds a debugfs interface and additional failure modes to LKDTM to provide similar functionality to the provoke-crash driver submitted here: Crashes can now be induced either through module parameters (as before) or through the debugfs interface as in provoke-crash. The patch also provides a new "direct" interface, where KPROBES are not used, i.e., the crash is invoked directly upon write to the debugfs file. When built without KPROBES configured, only this mode is available. Signed-off-by: Simon Kagstrom <> Cc: M. Mohan Kumar <> Cc: Americo Wang <> Cc: David Woodhouse <> Cc: Ingo Molnar <> Cc: "Eric W. Biederman" <>, Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2010-02-02fault injection: correct function names in documentationAnton Blanchard
init_fault_attr_entries() should be init_fault_attr_dentries(). cleanup_fault_attr_entries() should be cleanup_fault_attr_dentries(). Signed-off-by: Anton Blanchard <> Acked-by: Akinobu Mita <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2009-06-15debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem.GeunSik Lim
Many developers use "/debug/" or "/debugfs/" or "/sys/kernel/debug/" directory name to mount debugfs filesystem for ftrace according to ./Documentation/tracers/ftrace.txt file. And, three directory names(ex:/debug/, /debugfs/, /sys/kernel/debug/) is existed in kernel source like ftrace, DRM, Wireless, Documentation, Network[sky2]files to mount debugfs filesystem. debugfs means debug filesystem for debugging easy to use by greg kroah hartman. "/sys/kernel/debug/" name is suitable as directory name of debugfs filesystem. - debugfs related reference: Fix inconsistency of directory name to mount debugfs filesystem. * From Steven Rostedt - find_debugfs() and tracing_files() in this patch. Signed-off-by: GeunSik Lim <> Acked-by : Inaky Perez-Gonzalez <> Reviewed-by : Steven Rostedt <> Reviewed-by : James Smart <> CC: Jiri Kosina <> CC: David Airlie <> CC: Peter Osterlund <> CC: Ananth N Mavinakayanahalli <> CC: Anil S Keshavamurthy <> CC: Masami Hiramatsu <> Signed-off-by: Greg Kroah-Hartman <>
2007-07-16fault-injection: fix example scripts in documentationAkinobu Mita
Fix and cleanup example scripts in fault injection documentation. 1. Eliminate broken oops() shell function. 2. Fold and into example scripts. It makes the example scripts work independent of current working directory. 3. Set "space" parameter to 0 to start injecting errors immediately. 4. Use /sys/module/<modulename>/sections/.data as upper bound of .text section. Because some module doesn't have .exit.text section. Signed-off-by: Akinobu Mita <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2007-07-16fault-injection: add min-order parameter to fail_page_allocAkinobu Mita
Limiting smaller allocation failures by fault injection helps to find real possible bugs. Because higher order allocations are likely to fail and zero-order allocations are not likely to fail. This patch adds min-order parameter to fail_page_alloc. It specifies the minimum page allocation order to be injected failures. Signed-off-by: Akinobu Mita <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-12-08[PATCH] fault-injection: Correct, disambiguate, and reformat documentationDon Mullis
Correct, disambiguate, and reformat documentation. Signed-off-by: Don Mullis <> Cc: Akinobu Mita <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-12-08[PATCH] fault injection: stacktrace filteringAkinobu Mita
This patch provides stacktrace filtering feature. The stacktrace filter allows failing only for the caller you are interested in. For example someone may want to inject kmalloc() failures into only e100 module. they want to inject not only direct kmalloc() call, but also indirect allocation, too. - e100_poll --> netif_receive_skb --> packet_rcv_spkt --> skb_clone --> kmem_cache_alloc This patch enables to detect function calls like this by stacktrace and inject failures. The script Documentaion/fault-injection/ helps it. The range of text section of loaded e100 is expected to be [/sys/module/e100/sections/.text, /sys/module/e100/sections/.exit.text) So stores these values into /debug/failslab/address-start and /debug/failslab/address-end. The maximum stacktrace depth is specified by /debug/failslab/stacktrace-depth. Please see the example that demonstrates how to inject slab allocation failures only for a specific module in Documentation/fault-injection/fault-injection.txt [ reject failure if any caller lies within specified range] Signed-off-by: Akinobu Mita <> Signed-off-by: Don Mullis <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-12-08[PATCH] fault-injection capability for kmallocAkinobu Mita
This patch provides fault-injection capability for kmalloc. Boot option: failslab=<interval>,<probability>,<space>,<times> <interval> -- specifies the interval of failures. <probability> -- specifies how often it should fail in percent. <space> -- specifies the size of free space where memory can be allocated safely in bytes. <times> -- specifies how many times failures may happen at most. Debugfs: /debug/failslab/interval /debug/failslab/probability /debug/failslab/specifies /debug/failslab/times /debug/failslab/ignore-gfp-highmem /debug/failslab/ignore-gfp-wait Example: failslab=10,100,0,-1 slab allocation (kmalloc(), kmem_cache_alloc(),..) fails once per 10 times. Cc: Pekka Enberg <> Signed-off-by: Akinobu Mita <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-12-08[PATCH] fault injection: documentation and scriptsAkinobu Mita
This patch set provides some fault-injection capabilities. - kmalloc() failures - alloc_pages() failures - disk IO errors We can see what really happens if those failures happen. In order to enable these fault-injection capabilities: 1. Enable relevant config options (CONFIG_FAILSLAB, CONFIG_PAGE_ALLOC, CONFIG_MAKE_REQUEST) and if you want to configure them via debugfs, enable CONFIG_FAULT_INJECTION_DEBUG_FS. 2. Build and boot with this kernel 3. Configure fault-injection capabilities behavior by boot option or debugfs - Boot option failslab= fail_page_alloc= fail_make_request= - Debugfs /debug/failslab/* /debug/fail_page_alloc/* /debug/fail_make_request/* Please refer to the Documentation/fault-injection/fault-injection.txt for details. 4. See what really happens. Signed-off-by: Akinobu Mita <> Signed-off-by: Don Mullis <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>