Enable Multi-Gen LRU (#2392)

* Enable Multi-Gen LRU

Multi-Gen LRU should improve performance under memory pressure. This is
especially useful for embedded platforms where memory is scarce.

* Add service to configure Multi-Gen LRU

Use min_ttl_ms of 1 which is the least aggressive in terms of lag. Since
we are a server application, we can tune trashing prevention with a
higher acceptable lag.
This commit is contained in:
Stefan Agner 2023-03-31 23:28:43 +02:00 committed by GitHub
parent bdb3bd3ab1
commit c7588e9350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -15,7 +15,7 @@ CONFIG_ZSWAP_ZPOOL_DEFAULT_ZSMALLOC=y
CONFIG_ZSMALLOC=y
CONFIG_LRU_GEN=y
# CONFIG_LRU_GEN_ENABLED is not set
CONFIG_LRU_GEN_ENABLED=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

View File

@ -0,0 +1,11 @@
[Unit]
Description=Configure multigenerational LRU
ConditionPathExists=/sys/kernel/mm/lru_gen/enabled
[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo 1 > /sys/kernel/mm/lru_gen/min_ttl_ms"
[Install]
WantedBy=basic.target