Page MenuHomeFreeBSD

Move typically true check for static syscall out of syscall_thread_enter/exit functions into an inline.
AbandonedPublic

Authored by mjg on Oct 25 2014, 2:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 4, 6:19 AM
Unknown Object (File)
Sat, Feb 28, 10:00 AM
Unknown Object (File)
Sun, Feb 22, 8:08 AM
Unknown Object (File)
Sat, Feb 14, 3:21 PM
Unknown Object (File)
Wed, Feb 11, 3:23 AM
Unknown Object (File)
Thu, Feb 5, 7:30 PM
Unknown Object (File)
Feb 2 2026, 10:34 AM
Unknown Object (File)
Dec 24 2025, 5:35 PM
Subscribers
None

Details

Reviewers
jhb
Summary

Move typically true check for static syscall out of syscall_thread_enter/exit functions into an inline.

Prefix original functions with an _.

According to ministat this gives roughly a 4% speedup when calling getuid()
in a loop (syscall_timing benchmark found in tools/tools).

I was considering getting rid of 'td' argument as well as it is unused.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

mjg retitled this revision from to Move typically true check for static syscall out of syscall_thread_enter/exit functions into an inline..
mjg updated this object.
mjg edited the test plan for this revision. (Show Details)
mjg abandoned this revision.EditedOct 13 2017, 8:03 PM

the idea is half-crap - this code still remains in the hot path, even though it can be eliminated. this can be accomplished by providing a extra system call table and a proxy handler installed in the regular one. the proxy handler will inspect regs and whatnot and will get the syscall number + args from there. it can then proceed to do the crappery to safely call the syscall.