cregit-Linux how code gets into the kernel

Release 4.11 mm/failslab.c

Directory: mm
#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

PersonTokensPropCommitsCommitProp
Akinobu Mita4150.62%125.00%
Jesper Dangaard Brouer2328.40%125.00%
Dmitriy Monakhov1518.52%125.00%
Mel Gorman22.47%125.00%
Total81100.00%4100.00%


static int __init setup_failslab(char *str) { return setup_fault_attr(&failslab.attr, str); }

Contributors

PersonTokensPropCommitsCommitProp
Akinobu Mita22100.00%1100.00%
Total22100.00%1100.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

PersonTokensPropCommitsCommitProp
Akinobu Mita8985.58%350.00%
Dmitriy Monakhov1312.50%116.67%
Mel Gorman10.96%116.67%
Al Viro10.96%116.67%
Total104100.00%6100.00%

late_initcall(failslab_debugfs_init); #endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */

Overall Contributors

PersonTokensPropCommitsCommitProp
Akinobu Mita19471.85%333.33%
Dmitriy Monakhov3512.96%111.11%
Jesper Dangaard Brouer2910.74%111.11%
Mel Gorman51.85%111.11%
Viresh Kumar41.48%111.11%
Pekka J Enberg20.74%111.11%
Al Viro10.37%111.11%
Total270100.00%9100.00%
Directory: mm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.