linux透明大页介绍说明
2016-12-15 11:20
459 查看
Transparent Huge Pages的一些官方介绍资料:
Transparent Huge Pages (THP) are enabled by default in RHEL 6 for all applications. The kernel attempts to allocate hugepages whenever possible and any Linux process will receive 2MB pages if the mmap region is 2MB naturally aligned. The main kernel address
space itself is mapped with hugepages, reducing TLB pressure from kernel code. For general information on Hugepages, see: What are Huge Pages and what are the advantages of using them?
The kernel will always attempt to satisfy a memory allocation using hugepages. If no hugepages are available (due to non availability of physically continuous memory for example) the kernel will fall back to the regular 4KB pages. THP are also swappable (unlike
hugetlbfs). This is achieved by breaking the huge page to smaller 4KB pages, which are then swapped out normally.
But to use hugepages effectively, the kernel must find physically continuous areas of memory big enough to satisfy the request, and also properly aligned. For this, a khugepaged kernel thread has been added. This thread will occasionally attempt to substitute
smaller pages being used currently with a hugepage allocation, thus maximizing THP usage.
In userland, no modifications to the applications are necessary (hence transparent). But there are ways to optimize its use. For applications that want to use hugepages, use of posix_memalign() can also help ensure that large allocations are aligned to huge
page (2MB) boundaries.
Also, THP is only enabled for anonymous memory regions. There are plans to add support for tmpfs and page cache. THP tunables are found in the /sys tree under /sys/kernel/mm/redhat_transparent_hugepage.
参考链接:
http://www.jb51.net/article/70168.htm
https://www.ibm.com/developerworks/cn/linux/l-cn-hugetlb/
http://www.lxway.net/9988644.html
Transparent Huge Pages (THP) are enabled by default in RHEL 6 for all applications. The kernel attempts to allocate hugepages whenever possible and any Linux process will receive 2MB pages if the mmap region is 2MB naturally aligned. The main kernel address
space itself is mapped with hugepages, reducing TLB pressure from kernel code. For general information on Hugepages, see: What are Huge Pages and what are the advantages of using them?
The kernel will always attempt to satisfy a memory allocation using hugepages. If no hugepages are available (due to non availability of physically continuous memory for example) the kernel will fall back to the regular 4KB pages. THP are also swappable (unlike
hugetlbfs). This is achieved by breaking the huge page to smaller 4KB pages, which are then swapped out normally.
But to use hugepages effectively, the kernel must find physically continuous areas of memory big enough to satisfy the request, and also properly aligned. For this, a khugepaged kernel thread has been added. This thread will occasionally attempt to substitute
smaller pages being used currently with a hugepage allocation, thus maximizing THP usage.
In userland, no modifications to the applications are necessary (hence transparent). But there are ways to optimize its use. For applications that want to use hugepages, use of posix_memalign() can also help ensure that large allocations are aligned to huge
page (2MB) boundaries.
Also, THP is only enabled for anonymous memory regions. There are plans to add support for tmpfs and page cache. THP tunables are found in the /sys tree under /sys/kernel/mm/redhat_transparent_hugepage.
参考链接:
http://www.jb51.net/article/70168.htm
https://www.ibm.com/developerworks/cn/linux/l-cn-hugetlb/
http://www.lxway.net/9988644.html
相关文章推荐
- Centos 6.5 Install Mysql 8.0.0
- centos maven 安装与配置
- CentOS安装显卡驱动
- linux中seq命令用法
- Linux time命令输出的user、sys、real
- linux lvm的操作手册_pvcreate_vgcreate_lvcreate_相关
- centos7 安装谷歌浏览器
- linux各种格式的压缩解压
- 初始Linux系统——安装java
- Linux 字符设备驱动框架详细介绍
- linux之sed用法
- Linux权限设置
- gdb+gbserver调试
- Linux 服务器时间同步
- linux 添加分组及用户、权限设置、权限数字解析
- zabbix添加linux标准监控
- linux环境变量
- 解决无法通过80端口启动jar包问题
- CentOS 7 防火墙关闭、启动
- [课堂笔记]在VMware Workstation上安装linux系统的高级操作(自定义)--无界面安装