Skip to content

Commit 2ae6856

Browse files
wyr-7GUIDINGLI
authored andcommitted
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 <wangyongrong@xiaomi.com> Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
1 parent 34d8c37 commit 2ae6856

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎drivers/rpmsg/Kconfig‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,13 @@ config RPMSG_WQUEUE_NUMBER
6969

7070
config RPMSG_RECURSIVE_LIMIT
7171
int "rpmsg recursive limit"
72+
default 8 if ARCH_SIM
7273
default 2 if RPMSG_WQUEUE_STACKSIZE <= 4096
73-
default 3 if RPMSG_WQUEUE_STACKSIZE <= 6144
74-
default 4 if RPMSG_WQUEUE_STACKSIZE <= 8192
75-
default 5 if RPMSG_WQUEUE_STACKSIZE <= 10240
76-
default 6 if RPMSG_WQUEUE_STACKSIZE <= 12288
77-
default 7 if RPMSG_WQUEUE_STACKSIZE <= 14336
74+
default 3 if RPMSG_WQUEUE_STACKSIZE <= 5120
75+
default 4 if RPMSG_WQUEUE_STACKSIZE <= 6144
76+
default 5 if RPMSG_WQUEUE_STACKSIZE <= 7168
77+
default 6 if RPMSG_WQUEUE_STACKSIZE <= 8192
78+
default 7 if RPMSG_WQUEUE_STACKSIZE <= 9216
7879
default 8
7980
---help---
8081
This macro sets the maximum recursion depth allowed in the

0 commit comments

Comments
 (0)