Page MenuHomeFreeBSD

D44170.diff
No OneTemporary

D44170.diff

diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c
--- a/sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c
+++ b/sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c
@@ -151,6 +151,9 @@
return (MAX(allmem * 5 / 8, size));
}
+/* The flag indicating a running ARC pruning task. */
+static int arc_prune_running;
+
/*
* Helper function for arc_prune_async() it is responsible for safely
* handling the execution of a registered arc_prune_func_t.
@@ -172,6 +175,7 @@
#else
vnlru_free(nr_scan, &zfs_vfsops);
#endif
+ atomic_store_rel_int(&arc_prune_running, 0);
}
/*
@@ -188,6 +192,12 @@
void
arc_prune_async(int64_t adjust)
{
+ int ret;
+
+ /* Avoid piling up the ARC pruning tasks. */
+ ret = atomic_cmpset_acq_int(&arc_prune_running, 0, 1);
+ if (!ret)
+ return;
#ifndef __LP64__
if (adjust > INTPTR_MAX)

File Metadata

Mime Type
text/plain
Expires
Wed, May 20, 6:21 PM (2 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33353435
Default Alt Text
D44170.diff (896 B)

Event Timeline