HomeFreeBSD

Linux: Stop using NR_FILE_PAGES for ARC scaling

Description

Linux: Stop using NR_FILE_PAGES for ARC scaling

I've found that QEMU/KVM guest memory accounted as shared also
included into NR_FILE_PAGES. But it is actually a non-evictable
anonymous memory. Using it as a base for zfs_arc_pc_percent
parameter makes ARC to ignore shrinker requests while page cache
does not really have anything to evict, ending up in OOM killer
killing the QEMU process.

Instead use of NR_ACTIVE_FILE + NR_INACTIVE_FILE should represent
the part of a page cache that is actually evictable, which should
be safer to use as a reference for ARC scaling.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Reviewed-by: Pavel Snajdr <snajpa@snajpa.net>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #17334
(cherry picked from commit 0aa83dce99e47ccd533be24b82332268766b68db)

Details

Provenance
mavAuthored on May 14 2025, 1:29 PM
Tony Hutter <hutter2@llnl.gov>Committed on May 27 2025, 9:41 PM
Parents
rGc88e5a380c6a: Linux 6.0 compat: Check for migratepage VFS
Branches
Unknown
Tags
Unknown