mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
mm/mm_heap: add mempool to optimize small block performance
There are many small memory block in NuttX system, eg: struct tcb_s, struct inode, etc, and several disadvantages about them: 1.Their frequent allocate and free cause the system memory fragmentation. 2.Since each memory block has an overhead, the utilization of small memory blocks is relatively low, which will cause memory waste. So we can use mempool to alloc smallo block, to improve alloc speed and utilization, to reduce fragmentation. Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
+16
@@ -172,6 +172,22 @@ config MM_SHM
|
||||
Build in support for the shared memory interfaces shmget(), shmat(),
|
||||
shmctl(), and shmdt().
|
||||
|
||||
config MM_HEAP_MEMPOOL_THRESHOLD
|
||||
int "The size of threshold to avoid using multiple mempool in heap"
|
||||
default 0
|
||||
---help---
|
||||
If the size of the memory requested by the user is less
|
||||
than the threshold, the memory will be requested from the
|
||||
multiple mempool by default.
|
||||
|
||||
config MM_HEAP_MEMPOOL_EXPAND
|
||||
int "The expand size for each mempool in multiple mempool"
|
||||
default 1024
|
||||
depends on MM_HEAP_MEMPOOL_THRESHOLD != 0
|
||||
---help---
|
||||
This size describes the size of each expansion of each memory
|
||||
pool with insufficient memory in the multi-level memory pool.
|
||||
|
||||
config FS_PROCFS_EXCLUDE_MEMPOOL
|
||||
bool "Exclude mempool"
|
||||
default DEFAULT_SMALL
|
||||
|
||||
Reference in New Issue
Block a user