I am working on a checkpoint/Restart Linux kernel module. Wherein, a process sends a request to this module to checkpoint itself. In this process information about the process is stored in a file, which is used later on to restart the process.
我正在研究检查点/重启Linux内核模块。其中,进程向该模块发送请求以检查点本身。在此过程中,有关该过程的信息存储在一个文件中,稍后将使用该文件重新启动该过程。
Now when this module is storing the information related to pages (of the process) in a file, we also want to know on which NUMA node this page was assigned Can you suggest what will be the best way to get this data (page to NUMA node mapping). As I am in the kernel space, I would like to use the linux kernel functions itself to get this information.
现在,当这个模块将与页面(过程的)相关的信息存储在一个文件中时,我们也想知道这个页面被分配到哪个NUMA节点你能建议什么是获取这些数据的最佳方法(NUMA页面)节点映射)。由于我在内核空间,我想使用linux内核函数本身来获取这些信息。
I tried using page_to_nid(page), but I am not really sure it gives me correct value. (Like, I am working on linux 2.6.32, 64 bit machine with 16 cores and there are 4 NUMA nodes (4 cores on each) on it, but this function returns 32 when called)
我尝试使用page_to_nid(页面),但我不确定它给了我正确的价值。 (比如,我正在研究linux 2.6.32,64位机器,有16个核心,并且有4个NUMA节点(每个节点有4个核心),但是这个函数在被调用时返回32)
Thanks, Ajay
1 个解决方案
#1
1
You can read "Understanding the Linux Virtual Memory Manager", it states that:
您可以阅读“了解Linux虚拟内存管理器”,它指出:
node id: This is the Node ID (NID) of the node ...
node id:这是节点的节点ID(NID)...
So I'm pretty sure that page_to_nid should be the right function.
所以我很确定page_to_nid应该是正确的功能。
#1
1
You can read "Understanding the Linux Virtual Memory Manager", it states that:
您可以阅读“了解Linux虚拟内存管理器”,它指出:
node id: This is the Node ID (NID) of the node ...
node id:这是节点的节点ID(NID)...
So I'm pretty sure that page_to_nid should be the right function.
所以我很确定page_to_nid应该是正确的功能。