Re: Swap management: vm.swappiness best values?


Laurent Gauthier
 

Ciao Mauro,

Sounds more like a pure Linux/UNIX question than a yocto one :-)

As you most likely know on an embedded system which uses permanent storage (NAND flash or eMMC) that is subject to wear it is important to completely turn off swap.

At runtime if the system is up and running then you should issue the "swapoff -a" command.

But the proper fix is to remove any entry from your /etc/fstab designating a swap partition.

However I would be surprised if you had a swap partition configured in your system as most embedded systems don't have one.

Instead what I am thinking is that you are likely seeing a system slow-down due to your system's memory usage coming close to 100% of the available RAM, which in turn causes all calls to memory allocation functions to slow down (algorithms have to look harder to find available memory).

I would suggest that when the issue occurs that you first check the current system memory usage and have a look at which application is using the most memory and figure out if there is a way to optimize it and reduce the memory usage.

Kind regards, Laurent.


On Tue, Mar 9, 2021 at 10:03 AM Mauro Ziliani <mauro@...> wrote:
Hi all.
I'm working with Krogoth on a imx6dl board with 1GB of RAM.
I don't setup the swap space, but sometimes I see that kswap0 task starts, and the board slow down.

I'd like to change  the value of vm.swappiness to avoid swap requests

The default value  of vm.swappiness is 60.

There is a minimum value for vm.swappiness?

Best regards,
   MZ





--
Laurent Gauthier
Embedded Linux Systems & Software
Phone: +33 630 483 429
https://soccasys.com

Join yocto@lists.yoctoproject.org to automatically receive all group messages.