Red Hat Bugzilla – Bug 185422
Zone balancing issue when low on highmem
Last modified: 2010-10-22 00:38:02 EDT
On an x86 machine with 1GB of memory (or with a 1GB of simulated memory, using
the mem= kernel option), filling the pagecache and after that using a memory
intensive application will evict running processes to the swap, instead of
pruning the pagecache.
1. Create a 1.5GB file
2. run "cat bigfile > /dev/null"
3. run the attached test case
4. check the amount of swapped data:
- with mem=890M (no HighMem zone), there's nothing in the swap
- with mem=1G (129 megs in HighMem), there's about 2.6 megs of data in the swap
Full test results also attached.
Created attachment 126111 [details]
Created attachment 126112 [details]
To jfautley, the latest RHEL3 is U7 (released yesterday),
kernel version 2.4.21-40.EL. We are now doing development
for U8, which is where any potential hot fix would be based.
But there is no "previously-mentioned patch" in this bug report.
Sorry - my bad. I sent this to both bugzillas from issue-tracker. There is a
patch for RHEL4 in Bug 185092.
The other bugzilla has nothing to do with this issue, so there wouldn't be much
point in backporting it. Those issues shouldn't even be linked, and aren't anymore.
Created attachment 126919 [details]
Patch that stops the swapping when the systeh should reclaim pagecache memory
OK, the problem with the system is that the Highmem zone is only 1/8 of the
system RAM where the Normal zone is the remaining 7/8. This combined with the
fact that file system read and write operations deactivate pagecache pages
after they are done with them results in the system swapping rather than
reclaiming pagecache memory eventhough the total pagecache size is greater than
/proc/sys/vm/pagecache.maxpercnet. After the creation of the large file the
small Higmem zone is totally filled with pagecache pages although most of them
are on the inactive_dirty list. When the test.c program is run the system
quickly reclaims the pagecache pages from the Highmem zone and replaces them
with anonymous memory pages from the memory region that test.c allocated. Once
this occurs and the system runs out of memory it swaps out the Highmem because
that zone is totally consumed with anonymous pages even though the Normal zon
To fix this, I added another test in launder_page() to reactivate anonymous
pages if the total system pagecache size is less than pagecache.maxpercent.
This fixes the problem described here but we still need to do significant
performance testing before we can commit to addig this patch ro RHEL3-U8.
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
For more information of the RHEL errata support policy, please visit:
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.