Page MenuHomeFreeBSD

uma: Avoid allocating from free buckets when KASAN is enabled
AcceptedPublic

Authored by markj on Wed, Jul 15, 8:57 PM.
Tags
None
Referenced Files
F163035138: D58270.id.diff
Sun, Jul 19, 11:16 AM
F163003741: D58270.id182057.diff
Sun, Jul 19, 2:30 AM
Unknown Object (File)
Sat, Jul 18, 9:28 AM
Unknown Object (File)
Sat, Jul 18, 3:03 AM
Unknown Object (File)
Thu, Jul 16, 3:37 PM
Subscribers

Details

Reviewers
alc
rlibby
Summary

When uma_zalloc_arg() hits an empty alloc bucket in the per-CPU cache,
it tries swapping the alloc and free buckets in the hope that the free
bucket has some items available. If not, it has to lock the zone.

Disable this behaviour when KASAN is configured in order to further
defer reuse of freed items. This forces a free item to go to the
per-domain full bucket cache before it is becomes accessible to the
allocator.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74840
Build 71723: arc lint + arc unit

Event Timeline

markj requested review of this revision.Wed, Jul 15, 8:57 PM

The other thing that SMR does in this respect is it puts free buckets at the tail of uzd_buckets in zone_put_bucket. Did you think about whether you want that for KASAN also, to extend the length of time before reuse further?

Also, typo in commit log:

before it is becomes

This revision is now accepted and ready to land.Fri, Jul 17, 4:48 PM

The other thing that SMR does in this respect is it puts free buckets at the tail of uzd_buckets in zone_put_bucket. Did you think about whether you want that for KASAN also, to extend the length of time before reuse further?

No, I'd forgotten about that, good catch. I submitted a separate patch for it: https://reviews.freebsd.org/D58312

Also, typo in commit log:

before it is becomes

Fixed locally, thanks.