View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004989||CentOS-6||kernel||public||2011-07-20 15:29||2011-07-22 09:09|
|Target Version||Fixed in Version|
|Summary||0004989: Using mprotect across a 2MB page boundary locks up following memory access in the kernel|
Compile and run the attached program (which has been preprocessed) to demonstrate the problem.
The program uses mprotect to deny access rights to an 8KB region (two pages) that straddles a 2MB page boundary. It then writes a zero to the byte immediately following the pages with restricted access rights. The write never completes and oprofile will indicate that virtually 100% of the CPU time is being spent in the kernel.
|Tags||No tags attached.|
centos_kernel_lock.i (35,812 bytes)
centos_kernel_lock.c (2,736 bytes)
|I can make the test even simpler than this. It isn't necessary for the mprotect to straddle the 2MB boundary. If the region being mprotect'ed just starts on a 2MB boundary then it fails in the same way.|
I have found a work around for this apparent kernel bug. If as root you do:
echo never >/sys/kernel/mm/redhat_transparent_hugepage/enabled
then the issue goes away. Of course there may be a performance impact of disabling the use of huge pages.