Bug 427597

Summary: Can no longer use large pages for InnoDB buffer pool
Product: [Fedora] Fedora Reporter: Andrig Miller <andrig.t.miller>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: tgl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-07 23:08:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrig Miller 2008-01-05 01:42:57 UTC
Description of problem:

I have been using large page support for my InnoDB buffer pool for some time,
but it just stopped working, with an errno 12 (Out of Memory).  MySQL is the
first server to come up after boot, and there are 3072 pages of free HugePages,
as reported in /proc/meminfo:

HugePages_Total:  3072
HugePages_Free:   3072
HugePages_Rsvd:      0
Hugepagesize:     2048 kB

This is 6GB out of the total of 8GB on the server, and there is 1.3GB still free
of conventional memory.

Version-Release number of selected component (if applicable):

5.0.45-6-fc8

How reproducible:

Every time.

Steps to Reproduce:
1. Configure large page (HugeTLB) for the OS
2. Set large-pages = true in /etc/my.cnf
3. Set InnoDB buffer pool to some value smaller than the HugeTLB
  
Actual results:

080104 18:33:00  mysqld started
InnoDB: HugeTLB: Warning: Failed to allocate 1610629120 bytes. errno 12
InnoDB HugeTLB: Warning: Using conventional memory pool
080104 18:33:01  InnoDB: Started; log sequence number 2 2748257126
Warning: Failed to allocate 8388608 bytes from HugeTLB memory. errno 12
Warning: Using conventional memory pool


Expected results:

It should startup without the errno 12 lines, as it was before, with no problems.

Additional info:

I have tried changing the size of the InnoDB buffer pool to smaller numbers, but
it doesn't seem to matter what the number is, it always fails trying to shmget
to the HugeTLB memory.

Comment 1 Tom Lane 2008-01-05 03:47:56 UTC
Sounds more likely to be a kernel issue than anything else.

Comment 2 Andrig Miller 2008-01-07 22:33:33 UTC
I booted the older kernel I had on the system, and it stills fails the exact
same way, and also my Java Virtual Machine can successfully use the large pages
on the same system, so I don't think it is a kernel issue.

I will try to downgrade the MySQL database to the previous version, before the
last update, and see if that fixes the issue to isolate it even more.

Comment 3 Andrig Miller 2008-01-07 23:08:22 UTC
Well, I finally figured out what was going on, and it was user error.  I removed
the memlock soft and hard limits from /etc/security/limits.conf, even though the
database runs as the mysql user.  I still have to figure out why I need that for
it to work, but needless to say, this can be close.

Sorry for the trouble.