随着计算机科技的不断发展,安全问题越来越受到关注,其中内存管理安全也越来越被关注。在这个背景下,Oracle数据库针对透明大页(Transparent Huge Pages, THP)的问题进行了一系列的改进和研究,关闭透明大页,实现安全内存管理。透明大页是一个为Linux设计的内存管理技术,旨在提高系统性能和内存利用率。它通过把内存分为更大的块,减少了内存碎片,提高了访问效率。但同时,透明大页也有一些潜在的安全问题,例如碎片化攻击和缓存侧信道攻击等。为解决这些安全问题,Oracle关闭了透明大页。在Oracle 12.1版本之后,透明大页自动关闭,这也是Oracle从安全角度出发对透明大页的一次重大改进。目标本篇文章的目的是为了详细说明在运行 Linux 7和8内核为OL7上使用调优服务和禁用透明HugePages的步骤。解决方案
To keep THP disabled across a reboot, Please perform any one of the following action plans
Use a systemd(1) service to disable transparent hugepages
-
Create the
systemd(1) service definition file
/etc/systemd/system/disable-thp.service similar to this:
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
- 集合Robotaxi商业化所有想象,如祺出行登陆港交所,5年增值超60亿
集合Robotaxi商业化所有想象,如祺出行登陆港交所,5年增值超60亿
26-03-03 - 【YashanDB知识库】YashanDB 开机自启
【YashanDB知识库】YashanDB 开机自启
26-03-03 - 好烦啊,1个SQL干崩核心系统长达12小时!
好烦啊,1个SQL干崩核心系统长达12小时!
26-03-03 - 数据库管理-第220期 Oracle的高可用-03(20240715)
数据库管理-第220期 Oracle的高可用-03(20240715)
26-03-03 - Hitachi Vantara 发布由 AMD 驱动的高性能混合云和数据库解决方案
- 数据库管理-第217期 Oracle的高可用-02(20240704)
数据库管理-第217期 Oracle的高可用-02(20240704)
26-03-03 - 优思学院|亚马逊如何因六西格玛而取得成功?
优思学院|亚马逊如何因六西格玛而取得成功?
26-03-03 - 如何高效使用YashanDB PL语言?这5点建议值得收藏
如何高效使用YashanDB PL语言?这5点建议值得收藏
26-03-03 - 国产数据库都在学它,DG Broker完全颠覆你的想象!
国产数据库都在学它,DG Broker完全颠覆你的想象!
26-03-03 - 数据库管理-第205期 换个角度看23ai(20240617)
数据库管理-第205期 换个角度看23ai(20240617)
26-03-03
[Service] Type=simple ExecStart=/bin/sh -c "echo 'never' >/sys/kernel/mm/transparent_hugepage/enabled && echo 'never' >/sys/kernel/mm/transparent_hugepage/defrag" [Install] WantedBy=multi-user.target
Enable the new service to run automatically:
Disable transparent hugepages via the Linux kernel command line
-
Add the clause "
transparent_hugepage=never" to the
GRUB_CMDLINE_LINUX entry of
/etc/default/grub, like this:
For UEFI based machine run the below command for grub configuration change.
Disable Transparent Hugepages via tuned service
" tuned.service" on OL7 set the transparent_hugepage to always by default, even if it is disabled in grub kernel command line as above.
Verify the THP (Transparent hugepage) mode
# uname -r 3.10.0-229.el7.x86_64 # cat /sys/kernel/mm/transparent_hugepage/enabled [always] madvise never ← THP is enabled
Disable it globally on throughput-performance
-
Take a backup of "
/usr/lib/tuned/throughput-performance/tuned.conf", then change
"
transparent_hugepages=always" to
"
transparent_hugepages=never".
Disable it on active tuned profile
-
First Identify which profile is active.
Reboot the server and verify the outcome.
THP status in other UEK kernel versions
UEK3 disabled by default .
