HomeFreeBSD

fd: reorder struct file to reduce false sharing

Description

fd: reorder struct file to reduce false sharing

The size on LP64 is 80 bytes, which is just more than a cacheline, does
not lend itself to easy shrinking and rounding up to 2 would be a huge
waste given NOFREE marker.

The least which can be done is to reorder it so that most commonly used
fields are less likely to span different lines, and consequently suffer
less false sharing.

With the change at hand most commonly used fields land in the same line
about 3/4 of the time, as opposed to 2/4.

Details

Provenance
mjgAuthored on
Parents
rS367813: Add function getlocalbase() to libutil.
Branches
Unknown
Tags
Unknown