Module Name: src Committed By: hannken Date: Wed Apr 21 10:02:34 UTC 2021
Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: arc.c Log Message: 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.19 -r1.20 \ 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.19 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.20 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.19 Thu Jun 11 19:20:42 2020 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c Wed Apr 21 10:02:34 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;