Hey,
I'm currently working on a small project where I need to get the socket to which a PMem file is "closest". The basic idea is that the user provides a file or directory to a PMem-mounted filesystem, e.g., `/mnt/my-pmem/foo` (I have no control over this) and from that I want to programatically find out if the data is located in PMem closer to socket 0 or socket 1, i.e., /dev/pmem0 or /dev/pmem1. I want to use this information to explicitly pin threads to the NUMA node(s) of that socket later on in the application to avoid threads being spawned all over the place and accessing "remote" PMem.
Is there a way to do this in C/C++? I've played around with `get_mempolicy` and `move_pages` so far, but `get_mempolicy` always returns node 3 regardless of the actual location and `move_pages` is giving me "File exists" statuses for the moves, which is not documented in their man page.
I'd appreciate any advice/pointers.
Kind regards,
Lawrence