zephyr/subsys
Johan Hedberg 3fbf12487c kernel: Introduce a way to specify minimum system heap size
There are several subsystems and boards which require a relatively large
system heap (used by k_malloc()) to function properly. This became even
more notable with the recent introduction of the ACPICA library, which
causes ACPI-using boards to require a system heap of up to several
megabytes in size.

Until now, subsystems and boards have tried to solve this by having
Kconfig overlays which modify the default value of HEAP_MEM_POOL_SIZE.
This works ok, except when applications start explicitly setting values
in their prj.conf files:

$ git grep CONFIG_HEAP_MEM_POOL_SIZE= tests samples|wc -l
     157

The vast majority of values set by current sample or test applications
is much too small for subsystems like ACPI, which results in the
application not being able to run on such boards.

To solve this situation, we introduce support for subsystems to specify
their own custom system heap size requirement. Subsystems do
this by defining Kconfig options with the prefix HEAP_MEM_POOL_ADD_SIZE_.
The final value of the system heap is the sum of the custom
minimum requirements, or the value existing HEAP_MEM_POOL_SIZE option,
whichever is greater.

We also introduce a new HEAP_MEM_POOL_IGNORE_MIN Kconfig option which
applications can use to force a lower value than what subsystems have
specficied, however this behavior is disabled by default.

Whenever the minimum is greater than the requested value a CMake warning
will be issued in the build output.

This patch ends up modifying several places outside of kernel code,
since the presence of the system heap is no longer detected using a
non-zero CONFIG_HEAP_MEM_POOL_SIZE value, rather it's now detected using
a new K_HEAP_MEM_POOL_SIZE value that's evaluated at build.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-12-20 11:01:42 +01:00
..
bindesc
bluetooth Bluetooth: Mesh: remove 20ms tx delay in adv bearer 2023-12-19 16:20:36 +01:00
canbus
console
debug debug: gdbstub: kconfig: Add GDBSTUB_TRACE config option 2023-12-06 17:52:18 +00:00
demand_paging
dfu dfu: boot: mcuboot_shell: Prevent erasing MCUboot/app flash areas 2023-12-07 14:24:48 +00:00
disk
dsp
emul
fb
fs
input input: kbd_matrix: add an kbd_matrix_state shell command 2023-12-08 20:16:39 +00:00
ipc ipc_service: open-amp: Fix libmetal shared memory registration 2023-12-14 16:18:55 +02:00
jwt
llext llext: merge llext_mem and llext_section enums 2023-12-14 19:06:55 +00:00
logging logging: uart: cleanup device runtime PM checks 2023-12-06 18:00:21 -05:00
lorawan
mem_mgmt mem_mgmt: Add a memory attributes memory allocator 2023-11-27 19:56:48 +01:00
mgmt kernel: Introduce a way to specify minimum system heap size 2023-12-20 11:01:42 +01:00
modbus
modem modem: modem_cmux: Support modem CMUX DCE role 2023-12-08 20:17:58 +00:00
net kernel: Introduce a way to specify minimum system heap size 2023-12-20 11:01:42 +01:00
pm pm: Move settting timeout to after suspending devices 2023-12-18 09:29:49 +01:00
portability kernel: Introduce a way to specify minimum system heap size 2023-12-20 11:01:42 +01:00
random
retention retention: Increase read size variables to 16-bit 2023-12-14 19:05:22 +00:00
rtio
sd
sensing
settings settings: shell: Fix possible buffer overflow 2023-12-15 14:43:50 +01:00
shell kernel: Introduce a way to specify minimum system heap size 2023-12-20 11:01:42 +01:00
sip_svc
stats
storage
task_wdt
testsuite tests: userspace: exclude ucans32k1sic due to lack of MPU regions 2023-12-05 16:20:10 -06:00
timing
tracing pm: device_runtime: Add delay to async put 2023-12-12 10:57:34 +01:00
usb usb: device_next: uac2: interface descriptor macros 2023-12-15 14:24:44 +01:00
zbus kernel: Introduce a way to specify minimum system heap size 2023-12-20 11:01:42 +01:00
CMakeLists.txt
Kconfig