mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
mm: fault-inject take over bootstrap kmem_cache check
Remove the SLAB specific function slab_should_failslab(), by moving the check against fault-injection for the bootstrap slab, into the shared function should_failslab() (used by both SLAB and SLUB). This is a step towards sharing alloc_hook's between SLUB and SLAB. This bootstrap slab "kmem_cache" is used for allocating struct kmem_cache objects to the allocator itself. Signed-off-by: Jesper Dangaard Brouer <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Vladimir Davydov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
11c7aec2a9
commit
fab9963a69
4 changed files with 14 additions and 17 deletions
|
|
@ -360,7 +360,7 @@ static inline struct kmem_cache *slab_pre_alloc_hook(struct kmem_cache *s,
|
|||
lockdep_trace_alloc(flags);
|
||||
might_sleep_if(gfpflags_allow_blocking(flags));
|
||||
|
||||
if (should_failslab(s->object_size, flags, s->flags))
|
||||
if (should_failslab(s, flags))
|
||||
return NULL;
|
||||
|
||||
return memcg_kmem_get_cache(s, flags);
|
||||
|
|
|
|||
Loading…
Reference in a new issue