HomeFreeBSD

lockmgr: shrink struct lock by 8 bytes on LP64

Description

lockmgr: shrink struct lock by 8 bytes on LP64

Currently the struct has a 4 byte padding stemming from 3 ints.

  1. prio comfortably fits in short, unfortunately there is no dedicated type for it and plumbing it throughout the codebase is not worth it right now, instead an assert is added which covers also flags for safety
  2. lk_exslpfail can in principle exceed u_short, but the count is already not considered reliable and it only ever gets modified straight to 0. In other words it can be incrementing with an upper bound of USHRT_MAX

With these in place struct lock shrinks from 48 to 40 bytes.

Reviewed by: kib (previous version)
Differential Revision: https://reviews.freebsd.org/D28680

Details

Provenance
mjgAuthored on Feb 15 2021, 4:24 AM
Reviewer
kib
Differential Revision
D28680: lockmgr: shrink struct lock by 8 bytes on LP64
Parents
rGcc743b050acf: linux: drop unneeded casts
Branches
Unknown
Tags
Unknown