Closed ramosian-glider closed 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.
Should be fine now.
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, andkfence_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:cache->cpu_slab->freelist
for the cache inkfence_steal_freelist()
. In that case every allocation from that cache on every other CPU will be waiting forkfence_alloc_and_fix_freelist()
to finish and restore the freelists.kfence_steal_freelist()
and steal only the corresponding freelist.