On Thursday, October 31, 2019 at 9:03:24 AM UTC-6, J Kim wrote:
I'm Junghan from Korea and PhD student.
If I want to use the entire PM as single storage, Device Mapper in Linux is the best option?
Software RAID is one option, but may not be the 'best' option. It depends on the application requirements. 'Best' is not necessarily the 'optimal' solution. The 'optimal' solution is usually not to use SW RAID. This includes Device Mapper, mdadm, or LVM. Note that only the stripe and linear DeviceMapper code has DAX enablement. So only 4- or 8-socket systems, doing more complex RAID levels will not work with DAX.
Similar to the SW RAID solution are 'poolsets'. PMDK supports persistent memory pool sets, where a larger pool can be created from two or more smaller pools. Specifically, those smaller pools may be created on different NUMA nodes/CPU Sockets. The following example poolset config file creates a 400GiB memory pool using 2 x 200GiB files, one from CPU0 and one from CPU1 (assumes you have created the regions, namespaces, and mounted them on /pmemfs0 and /pmemfs1). At this time, we do lose NUMA locality information as PMDK will concatenate the smaller pools so you can lose performance depending on which CPU the thread is running when accessing the data.
PMEMPOOLSET
OPTION NOHDRS
200G /pmemfs0/myfile.part0
200G /pmemfs1/myfile.part1
See the
poolset(5) man page for more info.
I'm so curious about why not supported by processor and IMC?
Intel platforms are NUMA (Non-Uniform Memory Architecture). To have CPUs access any address with the same latency requires UMA (Uniform Memory Architecture).
Simplistically, Intel CPUs have an integrated memory controller (IMC) that manages memory physically located on that CPU sockets. If a request occurs on a CPU that is out of range, the CPU has a directory it can lookup to forward the request to the CPU that does manage the requested memory address. The request then goes over the UPI interface to satisfy the request. To learn more about how the UPI and directory updates work, take a look at these videos:
The BIOS has several tunables to manage the directory behaviour.
The bigger problem I think is that even when using Device Mapper, PMDK does not allocate memory considering SW-based interleaved PM. It allocates the memory to only Socket-0's PM. Please let me know. Thanks.
When you introduce RAID, we lose the NUMA locality information. For this reason, it is recommended to make the application NUMA aware, if not already, meaning it can memory map files (persistent memory pools) from any of the CPU sockets on the host and ensure threads run on the appropriate CPU. There are several techniques to achieve this including, but not limited to, some of the following:
- The app creates pools of worker threads to handle the data requests. Each thread pool is assigned to a specific CPU socket using a local persistent memory pool
- The app assigns specific data structures to specific persistent memory pools
In summary, apps should be NUMA aware and be designed to access data optimally by running threads on the CPUs closest to the data to which they need access (read or write).
HTH
Steve