Commit 7a46534
committed
dp: Fix DP scheduler locking
When at least two DP modules are running, each on a separate core, using
irq_lock() may lead to interrupts being disabled for a very long time.
When module_is_ready_to_process() always returns true, the DP task is
executed in a loop all the time except for periods when preempted by
higher priority threads. irq_lock() disables interrupts globally. Using
irq_lock() on multiple cores can lead to unbalanced double locks without
unlock in between.
Consider the case: core 1 calls irq_lock(1); this does not prevent core 2
from also calling flags = irq_lock(2); now flags contains the "interrupts
disabled" state as interrupts were previously globally disabled by core 1.
Then core 1 calls irq_unlock() -- interrupts are re-enabled; then core 2
calls irq_unlock(flags) to restore interrupts, which actually leads to
interrupts being disabled. On the next loop iteration, core 1 calls
flags = irq_lock(1), and since then interrupts might be disabled forever
with only two DP threads constantly running.
This fixes a regression in multicore DP tests. The issue is triggered by
this commit 4225c27, which just allows
the DP task to run all the available time without being triggered by LL
for every cycle.
Signed-off-by: Serhiy Katsyuba <[email protected]>1 parent 03044fc commit 7a46534
1 file changed
+6
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 55 | | |
61 | 56 | | |
62 | 57 | | |
| |||
67 | 62 | | |
68 | 63 | | |
69 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| 82 | + | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 84 | | |
| 85 | + | |
106 | 86 | | |
107 | 87 | | |
108 | 88 | | |
| |||
0 commit comments