-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
risc-v: Accelerate schedule by percpu #15081
base: master
Are you sure you want to change the base?
Conversation
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. While it provides a summary of the change and mentions testing, it lacks crucial details. Here's what's missing:
The PR needs to be significantly more detailed to be considered complete. Provide the missing information to ensure reviewers can properly assess the change. |
fe66e6f
to
ba568f6
Compare
arch/risc-v/include/arch.h
Outdated
@@ -120,6 +245,84 @@ extern "C" | |||
#define EXTERN extern | |||
#endif | |||
|
|||
#ifndef __ASSEMBLY__ | |||
|
|||
/**************************************************************************** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot have APIs with riscv_ prefix in public arch.h, do we need these APIs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about change prefix to arch_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public arch api should start with up_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we only need move riscv_percpu_s to public heder files, all other definition can still keep in riscv_percpu.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example the stack pointers are needed immediately when entering exception_common. You cannot replace this functionality with anything else. I'm sorry, you need to think of something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about add a new option to control this behavior?
Allow the user to choose between using percpu registers to store the TCB to accelerate scheduling or maintaining the current functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I don't have any objections to this. It can work in flat mode.
Btw you could use tp in protected / kernel mode (CONFIG_SYSCALL=y), just swap the user tp with CSR_SCRATCH->tcb in exception_common, and update tp when a context switch occurs. This way even the protected builds could enjoy the speed benefit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not always enable the acceleration to simplify the code base, I don't see other arch provide this type of flexibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's implement it for flat build first
92d1a27
to
fdb91ee
Compare
21549c5
to
e0334c0
Compare
Fetch TCB info in percpu scratch register for better performance. Signed-off-by: Huang Qi <[email protected]>
Summary
Fetch TCB info in percpu scratch register for better performance.
Similar to 948ac9b
Impact
RISC-V arch level code
Testing
ostest