]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fd: reorder struct file to reduce false sharing
authorMateusz Guzik <mjg@FreeBSD.org>
Wed, 18 Nov 2020 19:47:24 +0000 (19:47 +0000)
committerMateusz Guzik <mjg@FreeBSD.org>
Wed, 18 Nov 2020 19:47:24 +0000 (19:47 +0000)
commit1463aa8cf25173f8dca62c1fa84a16e9664eefc0
tree0b92a196828717dadb3ddd39b1dcede044613bf5
parent30d21d279537e46629a697908d2d207c06bc310e
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.
sys/sys/file.h