Heterogeneous Memory Management Is Still Baking For Linux
We haven't written about HMM for Linux since the end of last year when version seven of the patches were published. Today, HMM is up to its ninth patch revision. This latest revision incorporates feedback from earlier code reviews and reworks some of the patch structure.
As explained by the longtime open-source graphics driver developer at Red Hat, "HMM (Heterogeneous Memory Management) is an helper layer for device that want to mirror a process address space into their own mmu. Main target is GPU but other hardware, like network device can take also use HMM. There is two side to HMM, first one is mirroring of process address space on behalf of a device. HMM will manage a secondary page table for the device and keep it synchronize with the CPU page table. HMM also do DMA mapping on behalf of the device (which would allow new kind of optimization further down the road). Second side is allowing to migrate process memory to device memory where device memory is unmappable by the CPU. Any CPU access will trigger special fault that will migrate memory back. This patchset does not deal with remote memory migration."
Heterogeneous Memory Management is needed as OpenCL 2.0+ requires support for mirroring a process address space. HMM will allow for using the discrete GPU memory in a transparent manner to the application and work for various other use-cases.
The latest fifteen patches for HMM on Linux can be found via this patch series.