Page MenuHomeFreeBSD

Implement unr64
ClosedPublic

Authored by mjg on Nov 20 2018, 3:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 2 2024, 12:44 PM
Unknown Object (File)
Oct 2 2024, 3:33 AM
Unknown Object (File)
Oct 1 2024, 8:58 PM
Unknown Object (File)
Sep 21 2024, 5:17 AM
Unknown Object (File)
Sep 20 2024, 6:36 AM
Unknown Object (File)
Sep 17 2024, 3:22 AM
Unknown Object (File)
Sep 15 2024, 9:02 PM
Unknown Object (File)
Sep 10 2024, 3:57 PM
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.