google / kernel-sanitizers

Linux Kernel Sanitizers, fast bug-detectors for the Linux kernel
https://google.github.io/kernel-sanitizers/
437 stars 87 forks source link

kfence: the great schism #75

Closed ramosian-glider closed 4 years ago

ramosian-glider commented 4 years ago

Split kfence.c into kfence_core.c (pool allocator, error reporting, debugfs) and kfence_steal.c (heartbeat timer and freelist stealing mechanism). This will ease trying other sampling approaches, e.g. the naive counter-based one. Those implementations will need to implement their own kfence_init() and use the API declared in kfence_core.h.

The change also helped discover an incorrect lock having been used in obj_show().

Signed-off-by: Alexander Potapenko glider@google.com

melver commented 4 years ago

Nice, thanks!

Does it make sense to move to mm/kfence/ at this point?

ramosian-glider commented 4 years ago

Yes, probably. I thought for two files it didn't make sense, but that was before kfence_core.h. I'll create the dir as well.