Page MenuHomeFreeBSD

getnetconfig: make nc_error a thread local variable
ClosedPublic

Authored by brooks on Feb 16 2026, 2:17 PM.
Tags
None
Referenced Files
F172821409: D55310.diff
Mon, Sep 21, 7:23 AM
Unknown Object (File)
Thu, Sep 17, 6:46 AM
Unknown Object (File)
Sun, Sep 13, 3:24 AM
Unknown Object (File)
Fri, Sep 4, 10:26 PM
Unknown Object (File)
Fri, Sep 4, 9:52 PM
Unknown Object (File)
Aug 17 2026, 12:35 PM
Unknown Object (File)
Aug 13 2026, 1:47 AM
Unknown Object (File)
Aug 13 2026, 12:18 AM
Subscribers

Details

Summary

Remove a bunch of complexity at the cost of 4 bytes of storage per
thread.

Sponsored by: DARPA, AFRL

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 70700
Build 67583: arc lint + arc unit

Event Timeline

I suspect the complexity wasn't to avoid 4 bytes per thread but more because TLS wasn't reliably working on all of our architectures when this was first written (but I could be wrong). :)

This revision is now accepted and ready to land.Feb 25 2026, 1:45 AM
In D55310#1269811, @jhb wrote:

I suspect the complexity wasn't to avoid 4 bytes per thread but more because TLS wasn't reliably working on all of our architectures when this was first written (but I could be wrong). :)

I'm sure that's true, it just turns out to be a small benefit in the common case. There are a bunch more of these that I'm tempted to convert, but they involve large structs.