Huge pages backed shared memory segment fails to allocate if its size is not a multiple of huge page size

Solution Verified - Updated -

Issue

shmget() and shmat() used with SHM_HUGETLB flag (i.e. allocating huge pages for this memory segment) fail to allocate shared memory if the size requested is not in the range [ N*HUGE_PAGE_SIZE - 4095, N*HUGE_PAGE_SIZE ] (where N is a natural number).

Environment

Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content