Release 4.11 mm/failslab.c
#include <linux/fault-inject.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include "slab.h"
static struct {
struct fault_attr attr;
bool ignore_gfp_reclaim;
bool cache_filter;
}
failslab = {
.attr = FAULT_ATTR_INITIALIZER,
.ignore_gfp_reclaim = true,
.cache_filter = false,
};
bool should_failslab(struct kmem_cache *s, gfp_t gfpflags)
{
/* No fault-injection for bootstrap cache */
if (unlikely(s == kmem_cache))
return false;
if (gfpflags & __GFP_NOFAIL)
return false;
if (failslab.ignore_gfp_reclaim && (gfpflags & __GFP_RECLAIM))
return false;
if (failslab.cache_filter && !(s->flags & SLAB_FAILSLAB))
return false;
return should_fail(&failslab.attr, s->object_size);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akinobu Mita | 41 | 50.62% | 1 | 25.00% |
Jesper Dangaard Brouer | 23 | 28.40% | 1 | 25.00% |
Dmitriy Monakhov | 15 | 18.52% | 1 | 25.00% |
Mel Gorman | 2 | 2.47% | 1 | 25.00% |
Total | 81 | 100.00% | 4 | 100.00% |
static int __init setup_failslab(char *str)
{
return setup_fault_attr(&failslab.attr, str);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akinobu Mita | 22 | 100.00% | 1 | 100.00% |
Total | 22 | 100.00% | 1 | 100.00% |
__setup("failslab=", setup_failslab);
#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
static int __init failslab_debugfs_init(void)
{
struct dentry *dir;
umode_t mode = S_IFREG | S_IRUSR | S_IWUSR;
dir = fault_create_debugfs_attr("failslab", NULL, &failslab.attr);
if (IS_ERR(dir))
return PTR_ERR(dir);
if (!debugfs_create_bool("ignore-gfp-wait", mode, dir,
&failslab.ignore_gfp_reclaim))
goto fail;
if (!debugfs_create_bool("cache-filter", mode, dir,
&failslab.cache_filter))
goto fail;
return 0;
fail:
debugfs_remove_recursive(dir);
return -ENOMEM;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akinobu Mita | 89 | 85.58% | 3 | 50.00% |
Dmitriy Monakhov | 13 | 12.50% | 1 | 16.67% |
Mel Gorman | 1 | 0.96% | 1 | 16.67% |
Al Viro | 1 | 0.96% | 1 | 16.67% |
Total | 104 | 100.00% | 6 | 100.00% |
late_initcall(failslab_debugfs_init);
#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akinobu Mita | 194 | 71.85% | 3 | 33.33% |
Dmitriy Monakhov | 35 | 12.96% | 1 | 11.11% |
Jesper Dangaard Brouer | 29 | 10.74% | 1 | 11.11% |
Mel Gorman | 5 | 1.85% | 1 | 11.11% |
Viresh Kumar | 4 | 1.48% | 1 | 11.11% |
Pekka J Enberg | 2 | 0.74% | 1 | 11.11% |
Al Viro | 1 | 0.37% | 1 | 11.11% |
Total | 270 | 100.00% | 9 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.