Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 81378 - memlock option not working
Summary: memlock option not working
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mysql
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tom Lane
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-01-08 16:52 UTC by Ion Badulescu
Modified: 2013-07-03 02:59 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-02-03 18:35:30 UTC


Attachments (Terms of Use)
fix for memlock problem (deleted)
2003-01-08 16:54 UTC, Ion Badulescu
no flags Details | Diff

Description Ion Badulescu 2003-01-08 16:52:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
If the mysql daemon is runing as a non-root user, it calls mlockall() after
switching uid's and consequently it fails to lock itself into memory.

All mysql versions are affected, from rh72 through rawhide.

The patch I'm attaching is against 3.23.54a (rawhide). It may not be the ideal
fix, but it is obviously correct and works for me.


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


How reproducible:
Always

Steps to Reproduce:
1. add "memlock" to the [mysqld] section in /etc/my.cnf
2. start mysqld
3. check its memlocked status (the L flag in the "ps ax" output)
    

Actual Results:  11958 pts/0    S      0:01  \_ /usr/libexec/mysqld


Expected Results:  12228 pts/0    SL     0:02  \_ /usr/libexec/mysqld


Additional info:

Non-working memlock causes mysqld to get paged out occassionally, with the
expected negative effects on performance.

Comment 1 Ion Badulescu 2003-01-08 16:54:18 UTC
Created attachment 89216 [details]
fix for memlock problem

Comment 2 Tom Lane 2004-02-03 18:35:30 UTC
Since this is a fairly noncritical issue, I don't think we should
maintain a private fix for it.  The bug should be filed upstream, that
is with MySQL AB.  (A quick look suggests that the issue is still
present in MySQL 4.0.17.)


Note You need to log in before you can comment on or make changes to this bug.