After more experience with different settings it seems that the behavior of vfs_cache_pressure was changed a lot between linux kernel version 5.3 and 5.4.
For cases where vfs_cache_pressure=1 did work nicely with version 5.3 you need something in range 30-90 for linux kernel version 5.4 to get the same behavior. I haven't been able to pinpoint which value would be the closest match to old value 1. Also, I haven't seen any information if this is intentional or not, but I guess this could be considered as working okay but requiring different configuration values. -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux-meta-hwe-5.4 in Ubuntu. https://bugs.launchpad.net/bugs/1931871 Title: low 'vfs_cache_pressure' causes bad real world latency Status in linux-meta-hwe-5.4 package in Ubuntu: New Bug description: I have an old workstation running kernel Linux desktop 5.4.0-74-lowlatency #83~18.04.1-Ubuntu SMP PREEMPT Tue May 11 17:19:13 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux and when I run echo 1 > /proc/sys/vm/vfs_cache_pressure to allow directory structure to be cached better and then run rsync path/to/A path/to/B multiple times where both A and B contain approximately 6.5 million files (~2.5 TB per directory) I randomly get long pauses (1-15 seconds) which freeze both the desktop and audio output. I get nothing in "sudo journalctl -f" until some software starts to fail (e.g. pulseaudio emits a warning about too high latency). With low "vfs_cache_pressure" the expected behavior would be to be able to keep dentries for those 13 million files and the repeated rsync calls should be pretty fast and not cause high I/O nor memory management load. I've been running with the above setting of "1" for years and I'm pretty sure I haven't noticed this issue before kernel 5.4 series so I think the kernel behavior has degraded. I'm pretty sure I'm not running out of RAM so this is probably a change in the dentry cache behavior or some other part of the kernel memory management. $ free -m total used free shared buff/cache available Mem: 31807 9649 6445 3262 15712 6252 Swap: 1590 1453 136 ProblemType: Bug DistroRelease: Ubuntu 18.04 Package: linux-lowlatency-hwe-18.04-edge 5.4.0.74.83~18.04.67 ProcVersionSignature: Ubuntu 5.4.0-74.83~18.04.1-lowlatency 5.4.114 Uname: Linux 5.4.0-74-lowlatency x86_64 ApportVersion: 2.20.9-0ubuntu7.24 Architecture: amd64 CurrentDesktop: MATE Date: Mon Jun 14 15:34:23 2021 EcryptfsInUse: Yes InstallationDate: Installed on 2019-01-05 (890 days ago) InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725) SourcePackage: linux-meta-hwe-5.4 UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux-meta-hwe-5.4/+bug/1931871/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp

