Page MenuHomeFreeBSD

vm_reserv: Group per-domain data in the same structure.
ClosedPublic

Authored by markj on Nov 15 2019, 11:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 10:29 PM
Unknown Object (File)
Nov 11 2023, 3:40 AM
Unknown Object (File)
Nov 10 2023, 7:12 PM
Unknown Object (File)
Nov 7 2023, 12:15 AM
Unknown Object (File)
Oct 10 2023, 2:41 AM
Unknown Object (File)
Oct 5 2023, 11:13 PM
Unknown Object (File)
Sep 2 2023, 5:30 AM
Unknown Object (File)
Sep 1 2023, 11:29 PM
Subscribers

Details

Summary

We currently have the per-domain partially populated reservation queues
and the per-domain queue locks. Define a new per-domain structure to
contain both of them. This puts the queue fields and lock in the same
cache line and avoids the false sharing within the old queue array.

Also fix field packing in the reservation structure. In many places we
assume that a domain index fits in 8 bits, so we can do the same there
as well. This reduces the size of the structure by 8 bytes.

Update some comments while here. No functional change intended.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27550
Build 25772: arc lint + arc unit

Event Timeline

I see nothing clearly wrong with this.

sys/vm/vm_reserv.c
247

How much memory do you lose in the gaps between elements?

This revision is now accepted and ready to land.Nov 16 2019, 5:45 AM
kib added inline comments.
sys/vm/vm_reserv.c
247

Whatever it is, removal of mtx_padalign vm_reserv_domain_lock compensates.

sys/vm/vm_reserv.c
247

Indeed, struct mtx_padalign is just a struct mtx with CACHE_LINE_SIZE alignment, so we are actually saving a small amount of memory.