From 00f135687f28565bfdb3b24462a8500622d724de Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sat, 12 Apr 2025 14:25:47 +1000 Subject: [PATCH 1/2] posix: options: don't imply `POSIX_MESSAGE_PASSING` Don't `imply POSIX_MESSAGE_PASSING` when `POSIX_API=y` as this option has a non-trivial RAM implication in `HEAP_MEM_POOL_ADD_SIZE_MQUEUE`. The `mq_*` API is minimally used in-tree, with all users already enabling the symbol directly. Signed-off-by: Jordan Yates --- lib/posix/options/Kconfig.profile | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/posix/options/Kconfig.profile b/lib/posix/options/Kconfig.profile index 4f97786b0d57..2eb0c9a11ce0 100644 --- a/lib/posix/options/Kconfig.profile +++ b/lib/posix/options/Kconfig.profile @@ -11,7 +11,6 @@ config POSIX_API select POSIX_NETWORKING if NETWORKING # inet_ntoa(), socket(), etc imply EVENTFD # eventfd(), eventfd_read(), eventfd_write() imply POSIX_FD_MGMT # open(), close(), read(), write() - imply POSIX_MESSAGE_PASSING # mq_open(), etc imply POSIX_MULTI_PROCESS # sleep(), getpid(), etc help This option enables the required POSIX System Interfaces (base definitions), all of PSE51, From 65805a367b3429ee936cdd872ee83aa0cb57aa57 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sat, 12 Apr 2025 16:00:19 +1000 Subject: [PATCH 2/2] posix: options: `POSIX_THREADS` require a stack `pthread_setspecific` requires a stack in order to allocate the `struct pthread_key_data` data structure. On 64 bit systems this data structure is 32 bytes, resulting in 160 bytes usage for the default 5 supported threads. Signed-off-by: Jordan Yates --- lib/posix/options/Kconfig.pthread | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/posix/options/Kconfig.pthread b/lib/posix/options/Kconfig.pthread index 4eef794039a3..438506fe2182 100644 --- a/lib/posix/options/Kconfig.pthread +++ b/lib/posix/options/Kconfig.pthread @@ -15,6 +15,9 @@ menuconfig POSIX_THREADS if POSIX_THREADS +config HEAP_MEM_POOL_ADD_SIZE_POSIX_THREADS + def_int 256 + config POSIX_THREAD_THREADS_MAX int "Maximum number of POSIX threads" default 5