-
Notifications
You must be signed in to change notification settings - Fork 7.6k
kernel: dynamic: Dynamic userspace stacks improvements #90803
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
base: main
Are you sure you want to change the base?
Conversation
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.
Minor nit - otherwise, LGTM
@softwarecki - can you please rebase? |
|
I should have checked out the failing checks first before hitting approve. |
Add the flags parameter to the z_thread_stack_alloc_pool function. Determine the maximum possible stack size based on the size of the reserved memory for stack and the thread type (flags). The stack size that can be used by a thread depend on its type (kerner/user). For the same stack size, the macros K_KERNEL_STACK_DECLARE and K_THREAD_STACK_DEFINE may reserve different amount of memory. Signed-off-by: Adrian Warecki <[email protected]>
|
Optimize stack pool usage by add the
flags
parameter to thez_thread_stack_alloc_pool
function and determine the maximum possible stack size based on the size of the reserved memory for stack and the thread type (flags).The stack size that can be used by a thread depend on its type (kerner/user). For the same stack size, the macros
K_KERNEL_STACK_DECLARE
andK_THREAD_STACK_DEFINE
may reserve different amount of memory. The actual memory required by the user thread stack may be larger than the user-specified size, as it can include additional reserved space.Fix dynamic user stack allocation by use the
K_THREAD_STACK_LEN
macro to determine the size of the memory that need to by allocated for the user stack.