Page MenuHomeFreeBSD

Predict that the userspace trap will likely be syscall
AbandonedPublic

Authored by trasz on Oct 3 2020, 5:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 12:16 PM
Unknown Object (File)
Feb 10 2024, 11:47 PM
Unknown Object (File)
Dec 20 2023, 2:03 AM
Unknown Object (File)
Dec 19 2023, 5:54 PM
Unknown Object (File)
Nov 24 2023, 1:44 PM
Unknown Object (File)
Nov 6 2023, 7:15 PM
Unknown Object (File)
Oct 24 2023, 9:34 AM
Unknown Object (File)
Oct 21 2023, 8:00 AM
Subscribers

Details

Reviewers
None
Summary

Predict that the userspace trap will likely be syscall. Shaves off
15 instructions.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33965
Build 31158: arc lint + arc unit

Event Timeline

trasz requested review of this revision.Oct 3 2020, 5:27 PM

So, I guess the intent of this and related changes is to decrease time spent in the syscall path. Does this pessimize the other cases? I do not have enough intuition to say what percentage of user traps are syscalls compared to page faults or interrupts, but I would still expect a non-trivial amount of the latter two.

We also might consider calling svc_handler directly from asm and skip the generic trap handler.

sys/riscv/riscv/trap.c
161

IMO we should either keep the trapframe argument or just inline the contents of svc_handler completely.

333

This assert seems less useful than before, since the assignment it checks for is now visible a few lines prior.

So, I guess the intent of this and related changes is to decrease time spent in the syscall path. Does this pessimize the other cases? I do not have enough intuition to say what percentage of user traps are syscalls compared to page faults or interrupts, but I would still expect a non-trivial amount of the latter two.

Yes, by about two instructions. However, other traps are usually quite slow anyway.

And yeah, I'm not quite sure about it either.

We also might consider calling svc_handler directly from asm and skip the generic trap handler.

Good idea, thanks.