Skip to content

Commit f0d77dc

Browse files
committed
doc: document system workqueue stack size calculation
Make note of the new method of determining the system workqueue size in the migration guide and the workqueue docs. Signed-off-by: Jordan Yates <[email protected]>
1 parent e3d9b17 commit f0d77dc

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

doc/kernel/services/threads/workqueue.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,23 @@ use of it.
215215
for example, if the new work items perform blocking operations that
216216
would delay other system workqueue processing to an unacceptable degree.
217217

218+
Stack Size
219+
==========
220+
221+
By default the stack size of the system workqueue is determined co-operatively
222+
among all users of the workqueue. The build system compares the value of all
223+
Kconfig symbols matching the pattern
224+
``CONFIG_SYSTEM_WORKQUEUE_MIN_STACK_SIZE_*`` and selects the largest value as
225+
the stack size. :kconfig:option:`CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE` is
226+
included in this calculation by its value being copied into
227+
:kconfig:option:`CONFIG_SYSTEM_WORKQUEUE_MIN_STACK_SIZE_DEFAULT`.
228+
229+
.. note::
230+
This behaviour can be disabled through
231+
:kconfig:option:`CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE_IGNORE_MIN`, in which
232+
case the value of :kconfig:option:`CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE` will
233+
be used directly.
234+
218235
How to Use Workqueues
219236
*********************
220237

doc/releases/migration-guide-4.2.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ Build System
2626
Kernel
2727
******
2828

29+
* The stack size of the system workqueue is now computed co-operatively
30+
among users as the maximum value of any Kconfig options whose name starts
31+
with ``CONFIG_SYSTEM_WORKQUEUE_MIN_STACK_SIZE_``. The existing
32+
:kconfig:option:`CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE` symbol value is copied
33+
to :kconfig:option:`CONFIG_SYSTEM_WORKQUEUE_MIN_STACK_SIZE_DEFAULT` so that
34+
it is included in the calculation without any application changes.
35+
The previous behaviour can be selected with
36+
:kconfig:option:`CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE_IGNORE_MIN`.
37+
2938
Boards
3039
******
3140

0 commit comments

Comments
 (0)