mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-07-12 10:47:40 +03:00
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 0aa83dce99
)
This commit is contained in:
parent
a2bcf194f8
commit
db290fd48b
@ -4,8 +4,8 @@
|
||||
/*
|
||||
* Create our own accessor functions to follow the Linux API changes
|
||||
*/
|
||||
#define nr_file_pages() global_node_page_state(NR_FILE_PAGES)
|
||||
#define nr_inactive_anon_pages() global_node_page_state(NR_INACTIVE_ANON)
|
||||
#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 */
|
||||
|
@ -862,7 +862,9 @@ pressure on the pagecache, yet still allows the ARC to be reclaimed down to
|
||||
.Sy zfs_arc_min
|
||||
if necessary.
|
||||
This value is specified as percent of pagecache size (as measured by
|
||||
.Sy NR_FILE_PAGES ) ,
|
||||
.Sy NR_ACTIVE_FILE
|
||||
+
|
||||
.Sy NR_INACTIVE_FILE ) ,
|
||||
where that percent may exceed
|
||||
.Sy 100 .
|
||||
This
|
||||
|
Loading…
Reference in New Issue
Block a user