Page MenuHomeFreeBSD

Implement unr64
ClosedPublic

Authored by mjg on Nov 20 2018, 3:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 10 2024, 3:38 AM
Unknown Object (File)
Nov 13 2023, 3:46 AM
Unknown Object (File)
Oct 19 2023, 3:33 AM
Unknown Object (File)
Oct 12 2023, 12:48 AM
Unknown Object (File)
Sep 30 2023, 1:42 PM
Unknown Object (File)
Sep 17 2023, 1:10 PM
Unknown Object (File)
Aug 28 2023, 2:32 AM
Unknown Object (File)
Aug 28 2023, 2:32 AM
Subscribers

Details

Summary

Important users of unr like tmpfs or pipes can get away with just ever-increasing counters, making the overhead of managing the state for 32 bit counters a pessimization.

The patch changes it to an atomic variable. This can be further sped up by making the counts variable "allocate" ranges and store them per-cpu.

To that end, the code mimics the 32-bit variant by having a struct.

Architectures which failed to build with 64-bit atomics use a mutex-protected routine.

tmpfs conversion will be done later.
pipe conversion will be committed separately. pipes get stated a lot, removing the benefit of lazy allocation in the first place, thus the code allocates unconditionally

Test Plan

tinderbox

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 20906

Event Timeline

mjg edited the summary of this revision. (Show Details)

I think this is fine, but note that it would make it highly likely for compat11 binaries (where ino numbers are 32bit) to see non-unique pipe inode numbers due to truncation.

sys/sys/systm.h
526

Can we provide some define in machine/atomic.h, like __ATOMIC_NO_64_OPS, and test this symbol instead of #ifdefing specific arches ?

This revision is now accepted and ready to land.Nov 20 2018, 9:44 AM
This revision was automatically updated to reflect the committed changes.