Bug 1581567 - [kernel] aggressive swap usage starting with kernel series 4.16.x
Summary: [kernel] aggressive swap usage starting with kernel series 4.16.x
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 28
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-23 06:14 UTC by Joachim Frieben
Modified: 2019-05-28 23:50 UTC (History)
17 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-05-28 23:50:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Swap usage for kernel 4.17.12-200.fc28 and a system with 8 GB of main memory (46.04 KB, image/png)
2018-08-11 09:24 UTC, Joachim Frieben
no flags Details
Swap usage for kernel 4.20.16-300.fc29 and a system with 8 GB of main memory (50.68 KB, image/png)
2019-03-26 15:53 UTC, Joachim Frieben
no flags Details

Description Joachim Frieben 2018-05-23 06:14:59 UTC
Description of problem:
After upgrading to kernel series 4.16.x, swap usage kicks in much earlier and more aggressively than for previous kernels, e.g. from the 4.15.x series. This can be seen easily when running virtual machines on a Fedora 28 host. Already with 4.15.x kernels, the increasing memory footprint of recent Fedora releases forced me to increase my system's memory from 4 GB to 8 GB in order to be able to use gnome-boxes' recommended memory size of 2 GB or more for a virtual machine. I now see that even when there is still much more than 1 GB of free memory available, swap usage sets in and can reach values of more than 100 MB which results in an increased system latency.

Version-Release number of selected component (if applicable):
kernel-4.16.8-300.fc28

How reproducible:
Always

Steps to Reproduce:
1. Work with several virtual machines with an allocated memory size of 4 GB. 
2. Watch swap usage.

Actual results:
After some time, swap usage becomes noticeable and can use more than 100 MB of swap space even when free memory was always far larger than 1 GB.

Expected results:
As long as memory usage is far below the physical memory size, usage of swap space is avoided.

Additional info:
For kernels from the 4.15.x series, a memory usage of close to 100 % was still possible before significant chunks of memory were dumped to the swap volume.

Comment 1 Justin M. Forbes 2018-07-23 15:06:14 UTC
*********** MASS BUG UPDATE **************

We apologize for the inconvenience.  There are a large number of bugs to go through and several of them have gone stale.  Due to this, we are doing a mass bug update across all of the Fedora 28 kernel bugs.

Fedora 28 has now been rebased to 4.17.7-200.fc28.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.

If you experience different issues, please open a new bug report for those.

Comment 2 Joachim Frieben 2018-08-11 09:24:03 UTC
Created attachment 1475203 [details]
Swap usage for kernel 4.17.12-200.fc28 and a system with 8 GB of main memory

This swap usage has been observed after running several VM sessions with a main memory of 4 GB on a host with 8 GB of main memory running the latest kernel 4.17.12-200.fc28. Even though about 2 GB of the host's system memory have always stayed free, swap usage is approaching 1 GB of disk space. This swap policy results in a sluggish response of the virtual guest.
Swap usage is less significant when the swap size is smaller, e.g. 1 GB. Optimum performance is obtained when running from a live media with zero swap space.

Comment 3 Chuck Ebbert 2018-08-11 22:34:16 UTC
What do you have the vm.swappiness sysctl set to? Try setting it to 1.

Comment 4 Joachim Frieben 2018-08-12 13:54:25 UTC
The system default is vm.swappiness = 60. I have not changed anything myself. I do know that I can modify the value of vm.swappiness or even disable swap space altogether but my point is that this behaviour has only shown up recently, and that I do consider the current behaviour a regression.

Comment 5 Laura Abbott 2018-10-01 21:19:52 UTC
We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale.  Due to this, we are doing a mass bug update across all of the Fedora 28 kernel bugs.
 
Fedora 28 has now been rebased to 4.18.10-300.fc28.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.
 
If you have moved on to Fedora 29, and are still experiencing this issue, please change the version to Fedora 29.
 
If you experience different issues, please open a new bug report for those.

Comment 6 Joachim Frieben 2018-10-10 07:59:28 UTC
I think the issue is still present since today when e.g. only 6.2 GB out of 7.7 GB available system memory have been used at most, swap usage has reached more than 0.3 GB. The current kernel version is 4.18.12-200.fc28.

Comment 7 Justin M. Forbes 2019-01-29 16:24:55 UTC
*********** MASS BUG UPDATE **************

We apologize for the inconvenience.  There are a large number of bugs to go through and several of them have gone stale.  Due to this, we are doing a mass bug update across all of the Fedora 28 kernel bugs.

Fedora 28 has now been rebased to 4.20.5-100.fc28.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.

If you have moved on to Fedora 29, and are still experiencing this issue, please change the version to Fedora 29.

If you experience different issues, please open a new bug report for those.

Comment 8 Joachim Frieben 2019-03-26 15:53:14 UTC
Created attachment 1548130 [details]
Swap usage for kernel 4.20.16-300.fc29 and a system with 8 GB of main memory

Swap usage for a current Fedora 29 system which is running an idle GNOME session after rsyncing about 80 GB from an external hard drive to the system disk.

Comment 9 Ben Cotton 2019-05-02 19:45:04 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Ben Cotton 2019-05-28 23:50:31 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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