Commit 2779791
Jyri Sarha
schedule: use k_thread_cpu_pin() for CPU affinity
Replace the k_thread_cpu_mask_clear() + k_thread_cpu_mask_enable()
sequence with a single k_thread_cpu_pin() call.
The clear-then-enable pattern momentarily leaves the thread with a
zero CPU mask, which is invalid under CONFIG_SCHED_CPU_MASK_PIN_ONLY
and triggers an assertion after Zephyr commit 7798570a031d ("kernel:
sched: enforce non-zero CPU mask invariant in PIN_ONLY mode").
k_thread_cpu_pin() atomically sets exactly one bit in the mask,
avoiding the transient zero-mask state.
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>1 parent 26917d9 commit 2779791
3 files changed
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
466 | | - | |
| 465 | + | |
467 | 466 | | |
468 | 467 | | |
469 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
| 221 | + | |
223 | 222 | | |
224 | 223 | | |
225 | 224 | | |
| |||
337 | 336 | | |
338 | 337 | | |
339 | 338 | | |
340 | | - | |
341 | | - | |
| 339 | + | |
342 | 340 | | |
343 | 341 | | |
344 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
| |||
0 commit comments