Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

From
Vlastimil Babka <hidden>
Date
2020-09-08 19:54:27
Also in
linux-arm-kernel, linux-mm, lkml
Reply to
Marco Elver, 2020-09-08
On 9/8/20 5:31 PM, Marco Elver wrote:
quoted
How much memory overhead does this end up having?  I know it depends on
the object size and so forth.  But, could you give some real-world
examples of memory consumption?  Also, what's the worst case?  Say I
have a ton of worst-case-sized (32b) slab objects.  Will I notice?
KFENCE objects are limited (default 255). If we exhaust KFENCE's memory
pool, no more KFENCE allocations will occur.
Documentation/dev-tools/kfence.rst gives a formula to calculate the
KFENCE pool size:

	The total memory dedicated to the KFENCE memory pool can be computed as::

	    ( #objects + 1 ) * 2 * PAGE_SIZE

	Using the default config, and assuming a page size of 4 KiB, results in
	dedicating 2 MiB to the KFENCE memory pool.

Does that clarify this point? Or anything else that could help clarify
this?
Hmm did you observe that with this limit, a long-running system would eventually
converge to KFENCE memory pool being filled with long-aged objects, so there
would be no space to sample new ones?
Thanks,
-- Marco
  
Thread (54 messages) 54 messages, 10 authors, last reply 2020-09-16
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