[英]How to mount the huge tlb (huge page) as a file system?
Here is my machine details (ubuntu): 这是我的机器详细信息(ubuntu):
$uname -a
Linux rex-think 3.13.0-46-generic #76-Ubuntu SMP Thu Feb 26 18:52:13 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux Linux rex-think 3.13.0-46-generic#76-Ubuntu SMP Thu Feb 26 18:52:13 UTC 2015 x86_64 x86_64 x86_64 GNU / Linux
I have enabled huge page in root user with: 我已经在root用户中启用了巨大的页面:
$echo 20 > /proc/sys/vm/nr_hugepages
Now I want to mount huge page as a file system and open it for read/write, eg, using the C API below 现在,我想将巨大的页面作为文件系统挂载并打开以进行读取/写入,例如,使用下面的C API
#define FILE_NAME "/mnt/hugepages/hello"
fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755); // writing to huge page using file sys API
But I am not sure how to mount the huge page. 但是我不确定如何装入大页面。 In /proc/sys/vm/, I can see
在/ proc / sys / vm /中,我可以看到
hugetlb_shm_group hugepages_treat_as_movable hugetlb_shm_group hugepages_treat_as_movable
but from the description here , I dont think they are the files I am looking for. 但是从这里的描述来看,我认为它们不是我要查找的文件。
要将巨大的tlp挂载为文件系统,请使用以下命令
mount -t hugetlbfs nodev /mnt/huge
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.