Skip to content

Commit 52b6f32

Browse files
[nrf fromlist] ipc: ipc_service: Parametrize workqueue stack size
Add `EP_BOUND_WORK_Q_STACK_SIZE` config and parametrize its size dependending on the optimization level. Upstream PR #: 86103 Signed-off-by: Adam Kondraciuk <[email protected]>
1 parent 107f9f0 commit 52b6f32

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

subsys/ipc/ipc_service/backends/Kconfig.icbmsg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ config IPC_SERVICE_BACKEND_ICBMSG_NUM_EP
2323
backend. The number of endpoints are applied to all the instances,
2424
so this value should be maximum number among all the instances.
2525

26+
config IPC_SERVICE_BACKEND_ICBMSG_EP_BOUND_WORK_Q_STACK_SIZE
27+
int "Workqueue stack size"
28+
default 1024 if NO_OPTIMIZATIONS
29+
default 512
30+
help
31+
Workqueue stack size for bounding processing
32+
(this configuration is not optimized).
33+
2634
module = IPC_SERVICE_BACKEND_ICBMSG
2735
module-str = ICMSG backend with separate buffers
2836
module-help = Sets log level for ICMsg backend with buffers

subsys/ipc/ipc_service/backends/ipc_icbmsg.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ LOG_MODULE_REGISTER(ipc_icbmsg,
117117
/** Registered endpoints count mask in flags. */
118118
#define FLAG_EPT_COUNT_MASK 0xFFFF
119119

120-
/** Workqueue stack size for bounding processing (this configuration is not optimized). */
121-
#define EP_BOUND_WORK_Q_STACK_SIZE (512U)
122-
123120
/** Workqueue priority for bounding processing. */
124121
#define EP_BOUND_WORK_Q_PRIORITY (CONFIG_SYSTEM_WORKQUEUE_PRIORITY)
125122

@@ -1249,7 +1246,8 @@ static int backend_init(const struct device *instance)
12491246
MAYBE_CONST struct icbmsg_config *conf = (struct icbmsg_config *)instance->config;
12501247
struct backend_data *dev_data = instance->data;
12511248
#ifdef CONFIG_MULTITHREADING
1252-
static K_THREAD_STACK_DEFINE(ep_bound_work_q_stack, EP_BOUND_WORK_Q_STACK_SIZE);
1249+
static K_THREAD_STACK_DEFINE(ep_bound_work_q_stack,
1250+
CONFIG_IPC_SERVICE_BACKEND_ICBMSG_EP_BOUND_WORK_Q_STACK_SIZE);
12531251
static bool is_work_q_started;
12541252

12551253
#if defined(CONFIG_ARCH_POSIX)

0 commit comments

Comments
 (0)