-
Notifications
You must be signed in to change notification settings - Fork 364
schedule: use k_thread_cpu_pin() for CPU affinity #10953
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,8 +218,7 @@ static int zephyr_domain_register(struct ll_schedule_domain *domain, | |
| NULL, CONFIG_LL_THREAD_PRIORITY, 0, K_FOREVER); | ||
|
|
||
| #ifdef CONFIG_SCHED_CPU_MASK | ||
| k_thread_cpu_mask_clear(thread); | ||
| k_thread_cpu_mask_enable(thread, core); | ||
| k_thread_cpu_pin(thread, core); | ||
| #endif | ||
|
Comment on lines
220
to
222
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above
Comment on lines
220
to
222
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
| k_thread_name_set(thread, thread_name); | ||
|
|
||
|
|
@@ -337,8 +336,7 @@ static int zephyr_domain_thread_init(struct ll_schedule_domain *domain, | |
| K_USER, K_FOREVER); | ||
|
|
||
| #ifdef CONFIG_SCHED_CPU_MASK | ||
| k_thread_cpu_mask_clear(thread); | ||
| k_thread_cpu_mask_enable(thread, core); | ||
| k_thread_cpu_pin(thread, core); | ||
| #endif | ||
| k_thread_name_set(thread, thread_name); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,8 +114,7 @@ int scheduler_init_edf(void) | |
|
|
||
| k_thread_heap_assign(thread, sof_sys_heap_get()); | ||
| #ifdef CONFIG_SCHED_CPU_MASK | ||
| k_thread_cpu_mask_clear(thread); | ||
| k_thread_cpu_mask_enable(thread, PLATFORM_PRIMARY_CORE_ID); | ||
| k_thread_cpu_pin(thread, PLATFORM_PRIMARY_CORE_ID); | ||
| #endif | ||
|
Comment on lines
116
to
118
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is annother fix, not the one this PR is fixing. And the only reason that may cause k_thread_cpu_pin() to fail is that thread is already running, which is obviously not the case here, so check is quite futile. |
||
| k_thread_name_set(thread, "edf_workq"); | ||
|
|
||
|
|
||
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.
see above