返回顶部
首页 > 资讯 > 操作系统 >Red Hat Enterprise Linux 6 7关闭透明大页面及透明大页面基础概念
  • 328
分享到

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

2023-06-05 16:06:48 328人浏览 八月长安
摘要

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

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

--结束END--

本文标题: Red Hat Enterprise Linux 6 7关闭透明大页面及透明大页面基础概念

本文链接: https://lsjlt.com/news/243639.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作