Predict that the userspace trap will likely be syscall. Shaves off
15 instructions.
Details
- Reviewers
- None
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
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. |
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.