mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-06-03 04:15:02 +03:00

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
12 lines
351 B
C
12 lines
351 B
C
#ifndef _ZFS_PAGE_COMPAT_H
|
|
#define _ZFS_PAGE_COMPAT_H
|
|
|
|
/*
|
|
* Create our own accessor functions to follow the Linux API changes
|
|
*/
|
|
#define nr_file_pages() (global_node_page_state(NR_ACTIVE_FILE) + \
|
|
global_node_page_state(NR_INACTIVE_FILE))
|
|
#define nr_inactive_file_pages() global_node_page_state(NR_INACTIVE_FILE)
|
|
|
|
#endif /* _ZFS_PAGE_COMPAT_H */
|