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 subsys/bindesc: Fix kconfig dependency 2023-11-20 12:02:48 +01:00
bluetooth Bluetooth: Mesh: remove 20ms tx delay in adv bearer 2023-12-19 16:20:36 +01:00
canbus drivers: can: unify spelling of CAN Flexible Data-rate abbreviation 2023-11-01 11:17:17 +00:00
console
debug debug: gdbstub: kconfig: Add GDBSTUB_TRACE config option 2023-12-06 17:52:18 +00:00
demand_paging kernel: mm: only include demand_paging.h if needed 2023-11-23 10:01:45 +01:00
dfu dfu: boot: mcuboot_shell: Prevent erasing MCUboot/app flash areas 2023-12-07 14:24:48 +00:00
disk
dsp
emul emul: Don't panic if matching emul can't be found 2023-07-18 11:09:08 +00:00
fb fb: cfb: Remove unused value 2023-08-14 18:08:59 +00:00
fs flash host fuse access: Fix for native_sim 2023-11-17 09:23:48 +01:00
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 random: Rename random header 2023-10-10 14:23:50 +03:00
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 lorawan: use callback function signature typedefs 2023-11-13 09:53:32 +01:00
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 modbus: Add dependency to UART runtime configuration 2023-11-15 10:02:18 +01:00
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 syscall: rename Z_OOPS -> K_OOPS 2023-11-03 11:46:52 +01:00
retention retention: Increase read size variables to 16-bit 2023-12-14 19:05:22 +00:00
rtio syscall: rename Z_OOPS -> K_OOPS 2023-11-03 11:46:52 +01:00
sd sd: add SDIO subsystem 2023-11-06 19:01:08 -05:00
sensing sensing: sensor_mgmt: s/device.h/init.h 2023-08-29 12:17:24 +01:00
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 subsystem: sip_svc: Reduce the max timeout to 1 second. 2023-09-15 09:26:49 +02:00
stats shell: do not enable subsystem/driver shell modules by default 2023-11-20 09:21:40 +01:00
storage storage: rename shadow variables 2023-08-22 11:39:58 +02:00
task_wdt task_wdt: fix race condition for task_wdt_add function 2023-10-09 16:10:00 +03:00
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 drivers, subsys: sort the lists again, mark the blocks for checking 2023-11-13 09:41:05 +01:00
Kconfig drivers, subsys: sort the lists again, mark the blocks for checking 2023-11-13 09:41:05 +01:00