You are on page 1of 3

8/1/24, 9:50 Document 261889.

1
Copyright (c) 2024, Oracle. All rights reserved. Oracle Confidential.

Bigpages vs. Hugetlb on RedHat Linux (Doc ID 261889.1)

In this Document

Purpose
Scope
Details
References

APPLIES TO:

Linux OS - Version 2.4.9 and later


Linux x86
Linux Kernel - Version: 2.4.9

PURPOSE

This article will assist you to clarify which is the difference between Bigpages and Hugetlb on RedHat Linux

SCOPE

This is intended for Linux system administrators and Linux DBAs with sysadmin skills.

DETAILS

A typical big server deployment in RHAS2.1 would use bigpages as a bootup parameter to preallocate a large chunk of memory to be used solely for shared memory. These pages
have a 2MB or 4MB TLB entry that reduces the number of TLB misses and hence increases performance by a few percent.

The other advantage of using bigpages in RHAS2.1 was that it allowed the kernel VM not to worry too much about bookkeeping for that part of virtual memory. And these pages
are not pageable or swappable, so one can guarantee that the Oracle SGA remains in main physical memory.

Enterprise Linux 3 has replaced bigpages with a feature called hugetlb, a backport of what is also in Linux kernel 2.6. There are a few differences in how hugetlb works. Hugetlb
behavior is similar to that of bigpages; the pages are backed by large TLB entries, are not pageable, and are preallocated, which means that once you allocate x megabytes of
hugetlb pages, that amount of physical memory can be used only through hugetlbfs or shm allocated with SHM_HUGETLB.

RHEL3 no longer requires a bootup parameter; it is dynamically adjustable. After the system has booted, you can echo a value to '/proc/sys/vm/hugetlb_pool' or you can put the
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=fm9ulc51u_52&id=261889.1 1/3
8/1/24, 9:50 Document 261889.1
value you want in '/etc/sysctl.conf'. The value is in megabytes, and it allocates several 2MB pages.
You can see the values in '/proc/meminfo':

Hugepages_Total: 500
Hugepages_Free: 500
Hugepagesize: 2048K

Note, however, that the kernel needs to find 2MB contiguous physical pages for allocating the hugetlb pool. It does its best to get as many pages as possible, but if there is a lot of
fragmentation due to existing binaries running, the pool allocation will probably fail.

A program that wants to allocate shared memory has to add a flag, SHM_HUGETLB, to the shmget() flags. This approach ensures that the Oracle shared memory segments will be
allocated out of this pool.

Hugetlb can use solely for shared memory

Oracle Database 10g will do this by default; for Oracle9i Database, a patch is required and it's downlodable by metalink searching for Patch 3318884 - Abstract: MERGE LABEL
REQUEST ON TOP OF 9204 FOR 3267537 AND 3311507 available for 9.2.0.4 and 9.2.0.3

Refer
Upgrading from Red Hat Enterprise Linux 2.1 AS To Red Hat Enterprise Linux 3 on http://otn.oracle.com/pub/notes/technote_rhel3.html

Refer
The 'hugetlbpage.txt' under the Kernel's documentation on
<kernel_source _installation_path>/Documentation/vm
i.e.: '/usr/src/linux-2.4/Documentation/vm'

REFERENCES

NOTE:259772.1 - Red Hat Release 3.0; Advantages for Oracle


NOTE:275318.1 - The Bigpages Feature on Linux

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=fm9ulc51u_52&id=261889.1 2/3
8/1/24, 9:50 Document 261889.1

Didn't find what you are looking for?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=fm9ulc51u_52&id=261889.1 3/3

You might also like