Skip to content

Commit eef51a8

Browse files
committed
doc: kernel: move meta-irq doc to threads
Move this to where priorities are being discussed to keep things in context and to have all priority types documented in 1 place. Fixes #21648 Signed-off-by: Anas Nashif <[email protected]>
1 parent 9249609 commit eef51a8

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

doc/reference/kernel/scheduling/index.rst

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -203,38 +203,6 @@ becomes the current thread, its non-preemptible status is maintained.
203203
Locking out the scheduler is a more efficient way for a preemptible thread
204204
to prevent preemption than changing its priority level to a negative value.
205205

206-
.. _metairq_priorities:
207-
208-
Meta-IRQ Priorities
209-
===================
210-
211-
When enabled (see :kconfig:`CONFIG_NUM_METAIRQ_PRIORITIES`), there is a special
212-
subclass of cooperative priorities at the highest (numerically lowest)
213-
end of the priority space: meta-IRQ threads. These are scheduled
214-
according to their normal priority, but also have the special ability
215-
to preempt all other threads (and other meta-irq threads) at lower
216-
priorities, even if those threads are cooperative and/or have taken a
217-
scheduler lock.
218-
219-
This behavior makes the act of unblocking a meta-IRQ thread (by any
220-
means, e.g. creating it, calling k_sem_give(), etc.) into the
221-
equivalent of a synchronous system call when done by a lower
222-
priority thread, or an ARM-like "pended IRQ" when done from true
223-
interrupt context. The intent is that this feature will be used to
224-
implement interrupt "bottom half" processing and/or "tasklet" features
225-
in driver subsystems. The thread, once woken, will be guaranteed to
226-
run before the current CPU returns into application code.
227-
228-
Unlike similar features in other OSes, meta-IRQ threads are true
229-
threads and run on their own stack (which must be allocated normally),
230-
not the per-CPU interrupt stack. Design work to enable the use of the
231-
IRQ stack on supported architectures is pending.
232-
233-
Note that because this breaks the promise made to cooperative
234-
threads by the Zephyr API (namely that the OS won't schedule other
235-
thread until the current thread deliberately blocks), it should be
236-
used only with great care from application code. These are not simply
237-
very high priority threads and should not be used as such.
238206

239207
.. _thread_sleeping:
240208

doc/reference/kernel/threads/index.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,38 @@ ranges:
260260
For example, configuring 5 cooperative priorities and 10 preemptive priorities
261261
results in the ranges -5 to -1 and 0 to 9, respectively.
262262

263+
.. _metairq_priorities:
264+
265+
Meta-IRQ Priorities
266+
===================
267+
268+
When enabled (see :kconfig:`CONFIG_NUM_METAIRQ_PRIORITIES`), there is a special
269+
subclass of cooperative priorities at the highest (numerically lowest)
270+
end of the priority space: meta-IRQ threads. These are scheduled
271+
according to their normal priority, but also have the special ability
272+
to preempt all other threads (and other meta-irq threads) at lower
273+
priorities, even if those threads are cooperative and/or have taken a
274+
scheduler lock.
275+
276+
This behavior makes the act of unblocking a meta-IRQ thread (by any
277+
means, e.g. creating it, calling k_sem_give(), etc.) into the
278+
equivalent of a synchronous system call when done by a lower
279+
priority thread, or an ARM-like "pended IRQ" when done from true
280+
interrupt context. The intent is that this feature will be used to
281+
implement interrupt "bottom half" processing and/or "tasklet" features
282+
in driver subsystems. The thread, once woken, will be guaranteed to
283+
run before the current CPU returns into application code.
284+
285+
Unlike similar features in other OSes, meta-IRQ threads are true
286+
threads and run on their own stack (which must be allocated normally),
287+
not the per-CPU interrupt stack. Design work to enable the use of the
288+
IRQ stack on supported architectures is pending.
289+
290+
Note that because this breaks the promise made to cooperative
291+
threads by the Zephyr API (namely that the OS won't schedule other
292+
thread until the current thread deliberately blocks), it should be
293+
used only with great care from application code. These are not simply
294+
very high priority threads and should not be used as such.
263295

264296
.. _thread_options_v2:
265297

0 commit comments

Comments
 (0)