我的编程空间,编程开发者的网络收藏夹
学习永远不晚

Red Hat Enterprise Linux 6 7关闭透明大页面及透明大页面基础概念

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

Red Hat Enterprise Linux 6 7关闭透明大页面及透明大页面基础概念

https://access.redhat.com/solutions/46111

环境

  • Red Hat Enterprise Linux (RHEL) 6
  • Red Hat Enterprise Linux (RHEL) 7

问题

  • How do transparent hugepages work in RHEL 6?
  • How are transparent hugepages activated by a process?
  • Do we still need to preallocate some amount of memory for use as (transparent) hugepages?
  • How can I see the number of transparent hugepages that are actually in use on the system (either globally or by individual processes)?
  • How do I enable HugePages on Red Hat Enterprise Linux?
  • How do I disable HugePages on Red Hat Enterprise Linux?
  • Freezing issue while streaming out from RHEL 6.2 server, We are providing a streaming platform (RTSP, HLS) to our customers, based on RHEL 6.2 x86_64
    While streaming out, we experiencing delays (more than one to ten seconds) because of a process freeze and at the same point in time a bunch of memory is being freed
  • Need assistance to Disable Transparent Huge Pages (THP) in RHEL 7.4

决议

Note:
Transparent Huge Pages are not available on the 32-bit version of RHEL 6.
For RHEL 7 see How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7
For RHEL 8 see How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 8

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.

The values for /sys/kernel/mm/redhat_transparent_hugepage/enabled can be one of the following:

Raw

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

Red Hat Enterprise Linux 6 7关闭透明大页面及透明大页面基础概念

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

Red Hat Enterprise Linux 6 7关闭透明大页面及透明大页面基础概念

https://access.redhat.com/solutions/46111环境Red Hat Enterprise Linux (RHEL) 6Red Hat Enterprise Linux (RHEL) 7问题How do tr
2023-06-05

编程热搜

目录