This is an automated email from the ASF dual-hosted git repository.
GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 2ae68566697 drivers/rpmsg: tune the recursion limit for stack size and
sim
2ae68566697 is described below
commit 2ae6856669748366038acce92df6a4e60e0f070d
Author: wangyongrong <[email protected]>
AuthorDate: Wed Nov 18 10:33:55 2026 +0800
drivers/rpmsg: tune the recursion limit for stack size and sim
RPMSG_RECURSIVE_LIMIT grows by one level per 2KB of
RPMSG_WQUEUE_STACKSIZE. On sim the stack size is not the real limit:
sim adds CONFIG_SIM_STACKSIZE_ADJUSTMENT to every task stack, yet a
small RPMSG_WQUEUE_STACKSIZE still gives a limit of 2. With the rx work
queue stopped at that depth while its queued rx work held every buffer
from the remote, both cores asserted with "Get tx buffer timeout".
Default the limit to 8 on sim, where the stack is not a constraint.
On other targets one nesting level costs 336 to 528 bytes of framework
frames on ARM32, AArch64 and TriCore (see "drivers/rpmsg: scale
recursion limit with work queue stack size"). Keep 4KB at 2 levels and
add one level for every further 1KB, up to 8 levels above 9KB.
Signed-off-by: wangyongrong <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
---
drivers/rpmsg/Kconfig | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/rpmsg/Kconfig b/drivers/rpmsg/Kconfig
index 812f1892ef1..a85f5b52b50 100644
--- a/drivers/rpmsg/Kconfig
+++ b/drivers/rpmsg/Kconfig
@@ -69,12 +69,13 @@ config RPMSG_WQUEUE_NUMBER
config RPMSG_RECURSIVE_LIMIT
int "rpmsg recursive limit"
+ default 8 if ARCH_SIM
default 2 if RPMSG_WQUEUE_STACKSIZE <= 4096
- default 3 if RPMSG_WQUEUE_STACKSIZE <= 6144
- default 4 if RPMSG_WQUEUE_STACKSIZE <= 8192
- default 5 if RPMSG_WQUEUE_STACKSIZE <= 10240
- default 6 if RPMSG_WQUEUE_STACKSIZE <= 12288
- default 7 if RPMSG_WQUEUE_STACKSIZE <= 14336
+ default 3 if RPMSG_WQUEUE_STACKSIZE <= 5120
+ default 4 if RPMSG_WQUEUE_STACKSIZE <= 6144
+ default 5 if RPMSG_WQUEUE_STACKSIZE <= 7168
+ default 6 if RPMSG_WQUEUE_STACKSIZE <= 8192
+ default 7 if RPMSG_WQUEUE_STACKSIZE <= 9216
default 8
---help---
This macro sets the maximum recursion depth allowed in the