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)
Sun, Nov 24, 11:22 PM
Unknown Object (File)
Sat, Nov 16, 7:57 AM
Unknown Object (File)
Oct 1 2024, 5:03 AM
Unknown Object (File)
Sep 12 2024, 1:44 PM
Unknown Object (File)
Sep 7 2024, 12:23 PM
Unknown Object (File)
Sep 4 2024, 6:50 PM
Unknown Object (File)
Aug 29 2024, 3:09 PM
Unknown Object (File)
Aug 16 2024, 7:47 PM
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 34014
Build 31203: 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.

332

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.