Page MenuHomeFreeBSD

sockbuf: remove sbflush_internal() and sbrelease_internal() shims
Needs ReviewPublic

Authored by glebius on Fri, Mar 14, 6:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 17, 11:59 AM
Unknown Object (File)
Sun, Mar 16, 4:18 AM
Unknown Object (File)
Sun, Mar 16, 4:01 AM
Unknown Object (File)
Sun, Mar 16, 12:36 AM
Subscribers

Details

Reviewers
markj
Group Reviewers
network
Summary

This functions serve just one purpose - allow to call sbdestroy() from
sofree() without triggering unlocked mutex assertions. Let's just don't
save on locking with INVARIANTS kernel and this will allow to clean up all
these shims. Should be no functional changes.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62922
Build 59806: arc lint + arc unit

Event Timeline

This feels weird. Suppose there is some bug that is prevented by acquiring these mutexes. Now the bug will be absent in INVARIANTS kernels, but present in production kernels, which will making debugging very confusing. I'm not sure that this is worth it just to slightly simplify some call paths?

This feels weird. Suppose there is some bug that is prevented by acquiring these mutexes. Now the bug will be absent in INVARIANTS kernels, but present in production kernels, which will making debugging very confusing. I'm not sure that this is worth it just to slightly simplify some call paths?

Nope, it is the opposite! Right now there could be a bug that would call sbrelease_internal() without holding mutex and INVARIANTS won't catch that. Same for sbflush_internal. With the change, the functions start asserting the lock. And the only place that has a legitimate unlocked call is properly marked.