Module Name:    src
Committed By:   martin
Date:           Thu Apr 22 10:07:58 UTC 2021

Modified Files:
        src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-9]: arc.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1250):

        external/cddl/osnet/dist/uts/common/fs/zfs/arc.c: revision 1.20

Prevent blocking l2arc_feed_thread() forever, skip the
cv_timedwait() for negative or zero ticks.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.2 -r1.14.2.3 \
    src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.14.2.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.14.2.3
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.14.2.2	Wed Dec 11 14:46:28 2019
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c	Thu Apr 22 10:07:58 2021
@@ -7246,8 +7246,15 @@ l2arc_feed_thread(void *dummy __unused)
 
 	while (l2arc_thread_exit == 0) {
 		CALLB_CPR_SAFE_BEGIN(&cpr);
+#ifdef __NetBSD__
+		clock_t now = ddi_get_lbolt();
+		if (next > now)
+			(void) cv_timedwait(&l2arc_feed_thr_cv,
+			    &l2arc_feed_thr_lock, next - now);
+#else
 		(void) cv_timedwait(&l2arc_feed_thr_cv, &l2arc_feed_thr_lock,
 		    next - ddi_get_lbolt());
+#endif
 		CALLB_CPR_SAFE_END(&cpr, &l2arc_feed_thr_lock);
 		next = ddi_get_lbolt() + hz;
 

Reply via email to