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] Stolen freelists are CPU-local #62

Closed ramosian-glider closed 4 years ago

ramosian-glider commented 4 years ago

SLUB uses per-CPU freelists on allocation fast path, so we need to ensure we steal evenly from each CPU. kfence_steal_freelist() always steals the freelist from the current CPU, and kfence_fix_freelist()fixes it for the current CPU, even if the freelist was stolen from another CPU. We may want to do one of the following:

melver commented 4 years ago

I think the fairest result will be obtained by picking a random CPU. Fair as in on every system, regardless of number of CPUs, adjusting the sample rate has a predictable result on system behaviour without having to think about number of CPUs and factoring that into what the sample rate should be.

ramosian-glider commented 4 years ago

Should be fine now.