make: add compiletime preset for expected_resources

This commit is contained in:
Thomas Schoebel-Theuer 2025-03-20 12:11:22 +01:00
parent fa31059a80
commit ed6610a3f2
2 changed files with 10 additions and 1 deletions

View File

@ -234,6 +234,15 @@ config MARS_MEM_MAX_RESERVE
May be enabled when encountering suchalike problems
(known as accurring very rare, but may happen).
config MARS_EXPECTED_RESOURCES
int "optimize mem pre-alloc for expected_resources"
depends on MARS_MEM_MAX_RESERVE
default 12
help
In rare cases, when new resources are added to primaries,
the allocation of higher-order pages may lead to OOM.
Avoid this by pre-allocation at modprobe time.
config MARS_FAST_FULLSYNC
bool "decrease network traffic at initial sync"
depends on MARS

View File

@ -252,7 +252,7 @@ void _crashme(int mode, bool do_sync)
#define MARS_MEMRESERVE_ORDER 5
#define MEMRESERVE_FACTOR_5 32
int expected_resources;
int expected_resources = CONFIG_MARS_EXPECTED_RESOURCES;
int nr_affected_resources;
int tmp_nr_affected_resources;
int nr_prosumer_resources;