NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-evbarm/56944: ZFS heavy usage on NetBSD running in Mac M1 VM results in kernel thread running away and filesystem hang
The following reply was made to PR port-evbarm/56944; it has been noted by GNATS.
From: Tobias Nygren <tnn%NetBSD.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: port-evbarm/56944: ZFS heavy usage on NetBSD running in Mac M1
VM results in kernel thread running away and filesystem hang
Date: Wed, 27 Jul 2022 19:18:27 +0200
When pagedaemon is spinning it is indicative of a memory pressure
situation that is unresolvable. The interaction between pagedaemon and
zfs is primarily ARC reclamation. Some observations:
1) It doesn't look like we initialise zfs_arc_free_target, unlike FreeBSD.
2) FreeBSD has additional code to check for kva fragmentation which
we do not.
So it might be worthwhile to experiment with zfs_arc_free_target to
preemptively avoid the situation where the kernel fails to reclaim enough
pages to continue working. Here's a patch for zfs.kmod you could try:
--- external/cddl/osnet/dist/uts/common/fs/zfs/arc.c 4 May 2022 15:49:55 -0000 1.21
+++ external/cddl/osnet/dist/uts/common/fs/zfs/arc.c 27 Jul 2022 17:10:16 -0000
@@ -387,7 +387,7 @@ int zfs_arc_grow_retry = 0;
int zfs_arc_shrink_shift = 0;
int zfs_arc_p_min_shift = 0;
uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */
-u_int zfs_arc_free_target = 0;
+u_int zfs_arc_free_target = 32 * 1024 * 1024;
/* Absolute min for arc min / max is 16MB. */
static uint64_t arc_abs_min = 16 << 20;
@@ -3919,6 +3919,14 @@ arc_available_memory(void)
r = FMR_LOTSFREE;
}
+#ifdef __NetBSD__
+ n = PAGESIZE * ((int64_t)freemem - desfree);
+ if (n < lowest) {
+ lowest = n;
+ r = FMR_LOTSFREE;
+ }
+#endif
+
Home |
Main Index |
Thread Index |
Old Index