memtier [ -r ratio ] [ -t thresholds ] program args...
memtier runs the given program, redirecting memory allocations to different memory tiers based on a given policy. This allows unmodified programs to run following a non-greedy allocation scheme that avoids a performance cliff when DRAM is exhausted.
- -r ratio
Specifies the ratio as a pair of integers separated by a colon, where the first number gives the relative share of near DRAM to be used while the second number gives "far" memory, be it CXL memory or PMEM. Eg. "1:4" means that 20% of allocations will use DRAM, 80% PMEM.
If the ratio is not given, it defaults to the relative share of physically installed memory.
This version of memtier recognizes only two tiers (DRAM and KMEM_DAX).
- -t thresholds
Turns on DYNAMIC_THRESHOLD mode where small allocations are served from DRAM and large ones from far memory. The syntax is described in depth in man libmemtier, eg. -t INIT_VAL=1024,MIN_VAL=512,MAX_VAL=65536 starts with a threshold of 1024, then varies it between 512..65536 attempting to match the requested ratio.
Displays settings that are passed to libmemtier.
Shows a help message then exits.
This tool doesn't expose all features of libmemtier. Only DRAM and KMEM_DAX memory is supported, to use FS_DAX you need to configure the library directly, please refer to its man page.
Or alternatively, you can switch that memory to KMEM_DAX mode. For that purpose, please refer to "man ndctl-reconfigure-namespace" and "man daxctl-reconfigure-device".
libmemtier(7), memkind(3), malloc(3)