Re: [PATCH v4 01/11] mm: add Kernel Electric-Fence infrastructure

From
Marco Elver <elver@google.com>
Date
2020-10-02 21:28:26
Also in
linux-arm-kernel, linux-mm, lkml
Reply to
Jann Horn, 2020-10-02
On Fri, 2 Oct 2020 at 21:32, Jann Horn [off-list ref] wrote:
quoted
That's another check; we don't want to make this more expensive.
Ah, right, I missed that this is the one piece of KFENCE that is
actually really hot code until Dmitry pointed that out.

But actually, can't you reduce how hot this is for SLUB by moving
is_kfence_address() down into the freeing slowpath? At the moment you
use it in slab_free_freelist_hook(), which is in the super-hot
fastpath, but you should be able to at least move it down into
__slab_free()...

Actually, you already have hooked into __slab_free(), so can't you
just get rid of the check in the slab_free_freelist_hook()?
I missed this bit: the loop that follows wants the free pointer, so I
currently see how this might work. :-/

We'll look at your other email re optimizing is_kfence_address() next
week; and thank you for the detailed comments thus far!

Thanks,
-- Marco
Thread (36 messages) 36 messages, 6 authors, last reply 2020-10-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help