Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Prevent blocking ...
details: https://anonhg.NetBSD.org/src/rev/b335397eef7a
branches: trunk
changeset: 378659:b335397eef7a
user: hannken <hannken%NetBSD.org@localhost>
date: Wed Apr 21 10:02:34 2021 +0000
description:
Prevent blocking l2arc_feed_thread() forever, skip the
cv_timedwait() for negative or zero ticks.
diffstat:
external/cddl/osnet/dist/uts/common/fs/zfs/arc.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diffs (19 lines):
diff -r 846e9ff79f30 -r b335397eef7a external/cddl/osnet/dist/uts/common/fs/zfs/arc.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c Wed Apr 21 09:52:20 2021 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c Wed Apr 21 10:02:34 2021 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index