Allocating sufficiently available memory but not too much has been a challenge for MariaDB and MySQL users for a significant time.
The overallocation results in a risk of OOM killing of the server process.
Linux kernel this interface:
By receiving a memory event of memory pressure options are:
- madvice(DONT_NEED/FREE) on buf_pool.free
- Moving innodb buffer LRU pool chunks to free
- Resizing down innodb buffer pool
- Kill off thread cache thread(s)?
- table caches (are these large?)
So configuration would need a trigger values, "<some|full> <stall amount in us> <time window in us>", from the kernel interface. And a response for "some"/"full".