Re: [PATCH v2 6/7] mm, slab: add static key for should_failslab()

2024-06-25 Thread Vlastimil Babka
On 6/25/24 7:12 PM, Alexei Starovoitov wrote: > On Tue, Jun 25, 2024 at 7:24 AM Vlastimil Babka wrote: >> >> On 6/20/24 12:49 AM, Vlastimil Babka wrote: >> > --- a/mm/slub.c >> > +++ b/mm/slub.c >> > @@ -3874,13 +3874,37 @@ static __always_inline void >> > maybe_wipe_obj_freeptr(struct

Re: [PATCH v2 6/7] mm, slab: add static key for should_failslab()

2024-06-25 Thread Alexei Starovoitov
On Tue, Jun 25, 2024 at 7:24 AM Vlastimil Babka wrote: > > On 6/20/24 12:49 AM, Vlastimil Babka wrote: > > --- a/mm/slub.c > > +++ b/mm/slub.c > > @@ -3874,13 +3874,37 @@ static __always_inline void > > maybe_wipe_obj_freeptr(struct kmem_cache *s, > > 0, sizeof(void *)); >

Re: [PATCH v2 6/7] mm, slab: add static key for should_failslab()

2024-06-25 Thread Vlastimil Babka
On 6/20/24 12:49 AM, Vlastimil Babka wrote: > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -3874,13 +3874,37 @@ static __always_inline void > maybe_wipe_obj_freeptr(struct kmem_cache *s, > 0, sizeof(void *)); > } > > -noinline int should_failslab(struct kmem_cache *s, gfp_t

[PATCH v2 6/7] mm, slab: add static key for should_failslab()

2024-06-19 Thread Vlastimil Babka
Since commit 4f6923fbb352 ("mm: make should_failslab always available for fault injection") should_failslab() is unconditionally a noinline function. This adds visible overhead to the slab allocation hotpath, even if the function is empty. With CONFIG_FAILSLAB=y there's additional overhead, even