Page MenuHomeFreeBSD

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

Authored by markj on Nov 15 2019, 11:45 PM.
Referenced Files
Thu, Apr 25, 9:36 AM
F82075191: D22391.diff
Thu, Apr 25, 7:01 AM
Unknown Object (File)
Sat, Apr 20, 5:45 PM
Unknown Object (File)
Tue, Apr 16, 8:30 AM
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



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

rS FreeBSD src repository - subversion
Lint Not Applicable
Tests Not Applicable

Event Timeline

I see nothing clearly wrong with this.

247 ↗(On Diff #64407)

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.
247 ↗(On Diff #64407)

Whatever it is, removal of mtx_padalign vm_reserv_domain_lock compensates.

247 ↗(On Diff #64407)

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