Re: [PATCH RFC 3/4] mm, slab: add static key for should_failslab()

2024-06-02 Thread Alexei Starovoitov
On Sat, Jun 1, 2024 at 1:57 PM Vlastimil Babka wrote: > > On 5/31/24 6:43 PM, Alexei Starovoitov wrote: > > On Fri, May 31, 2024 at 2:33 AM Vlastimil Babka wrote: > >> might_alloc(flags); > >> > >> - if (unlikely(should_failslab(s, flags))) > >> - return NULL; > >> +

Re: [PATCH RFC 3/4] mm, slab: add static key for should_failslab()

2024-06-01 Thread Vlastimil Babka
On 5/31/24 6:43 PM, Alexei Starovoitov wrote: > On Fri, May 31, 2024 at 2:33 AM Vlastimil Babka wrote: >> might_alloc(flags); >> >> - if (unlikely(should_failslab(s, flags))) >> - return NULL; >> + if (static_branch_unlikely(_failslab_active)) { >> +

Re: [PATCH RFC 3/4] mm, slab: add static key for should_failslab()

2024-05-31 Thread Roman Gushchin
On Fri, May 31, 2024 at 11:33:34AM +0200, Vlastimil Babka wrote: > 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

Re: [PATCH RFC 3/4] mm, slab: add static key for should_failslab()

2024-05-31 Thread Yosry Ahmed
On Fri, May 31, 2024 at 9:44 AM Alexei Starovoitov wrote: > > On Fri, May 31, 2024 at 2:33 AM Vlastimil Babka wrote: > > > > Since commit 4f6923fbb352 ("mm: make should_failslab always available for > > fault injection") should_failslab() is unconditionally a noinline > > function. This adds

Re: [PATCH RFC 3/4] mm, slab: add static key for should_failslab()

2024-05-31 Thread Alexei Starovoitov
On Fri, May 31, 2024 at 2:33 AM Vlastimil Babka wrote: > > 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

[PATCH RFC 3/4] mm, slab: add static key for should_failslab()

2024-05-31 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 when