diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2010-02-26 01:36:12 -0500 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2010-02-26 12:19:39 -0500 |
commit | 4c13dd3b48fcb6fbe44f241eb11a057ecd1cba75 (patch) | |
tree | d9875477b9eb48ad598da8cbc36b473c941828ae /include | |
parent | 60b341b778cc2929df16c0a504c91621b3c6a4ad (diff) |
failslab: add ability to filter slab caches
This patch allow to inject faults only for specific slabs.
In order to preserve default behavior cache filter is off by
default (all caches are faulty).
One may define specific set of slabs like this:
# mark skbuff_head_cache as faulty
echo 1 > /sys/kernel/slab/skbuff_head_cache/failslab
# Turn on cache filter (off by default)
echo 1 > /sys/kernel/debug/failslab/cache-filter
# Turn on fault injection
echo 1 > /sys/kernel/debug/failslab/times
echo 1 > /sys/kernel/debug/failslab/probability
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fault-inject.h | 5 | ||||
-rw-r--r-- | include/linux/slab.h | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h index 06ca9b21dad2..7b64ad40e4ce 100644 --- a/include/linux/fault-inject.h +++ b/include/linux/fault-inject.h | |||
@@ -82,9 +82,10 @@ static inline void cleanup_fault_attr_dentries(struct fault_attr *attr) | |||
82 | #endif /* CONFIG_FAULT_INJECTION */ | 82 | #endif /* CONFIG_FAULT_INJECTION */ |
83 | 83 | ||
84 | #ifdef CONFIG_FAILSLAB | 84 | #ifdef CONFIG_FAILSLAB |
85 | extern bool should_failslab(size_t size, gfp_t gfpflags); | 85 | extern bool should_failslab(size_t size, gfp_t gfpflags, unsigned long flags); |
86 | #else | 86 | #else |
87 | static inline bool should_failslab(size_t size, gfp_t gfpflags) | 87 | static inline bool should_failslab(size_t size, gfp_t gfpflags, |
88 | unsigned long flags) | ||
88 | { | 89 | { |
89 | return false; | 90 | return false; |
90 | } | 91 | } |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 2da8372519f5..488446289cab 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -70,6 +70,11 @@ | |||
70 | #else | 70 | #else |
71 | # define SLAB_NOTRACK 0x00000000UL | 71 | # define SLAB_NOTRACK 0x00000000UL |
72 | #endif | 72 | #endif |
73 | #ifdef CONFIG_FAILSLAB | ||
74 | # define SLAB_FAILSLAB 0x02000000UL /* Fault injection mark */ | ||
75 | #else | ||
76 | # define SLAB_FAILSLAB 0x00000000UL | ||
77 | #endif | ||
73 | 78 | ||
74 | /* The following flags affect the page allocator grouping pages by mobility */ | 79 | /* The following flags affect the page allocator grouping pages by mobility */ |
75 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ | 80 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ |