Bug 214038

Summary: Kernel starts swapping when 148780k free/3054716k cached
Product: [Fedora] Fedora Reporter: Robert Scheck <redhat-bugzilla>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: triage, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-04 19:22:07 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 Robert Scheck 2006-11-04 22:44:53 UTC
Description of problem:
IMHO the following kernel behaviour is broken:

$ free
             total       used       free     shared    buffers     cached
Mem:       3960936    3812156     148780          0     195840    3054716
-/+ buffers/cache:     561600    3399336
Swap:      1048552         64    1048488
$

Why the hell does the kernel start swapping when 148780k free and 3054716k 
cached? Okay, currently only 64k are swapped but this is unnecessary when 
148780k are free, isn't it?

Version-Release number of selected component (if applicable):
kernel-2.6.18-1.2798.fc6

How reproducible:
Put 4 GB of RAM into a server and rebuild gcc, no swapping. Let the box run it's 
normal services (httpd, vsftpd, sshd etc.) with low use (< 0.25 load) after it - 
without rebooting the box between - and see what I posted above.

Actual results:
Kernel starts swapping when 148780k free/3054716k cached

Expected results:
Swapping first when RAM is completely used...

Comment 1 Bug Zapper 2008-04-03 18:35:39 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 2 Robert Scheck 2008-04-03 20:46:03 UTC
Hum? Since when is Rawhide no longer maintained? The problem still exists in 
Rawhide.

Comment 3 Bug Zapper 2008-05-14 02:27:12 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Dave Jones 2008-06-04 19:22:07 UTC
I believe what you're seeing is the effect of the swap cache. Where something
was swapped out briefly (whilst there was memory pressure), and we keep
references to the swapped out version on disk just in case the situation
reoccurs, so that we don't have to write it out to swap a second time, we just
throw out the in-memory references.