summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_kern.c
diff options
context:
space:
mode:
authorjh <jh@FreeBSD.org>2010-11-22 16:47:53 +0000
committerjh <jh@FreeBSD.org>2010-11-22 16:47:53 +0000
commit9c043d590896a77d5d66b978a963573a41d66ad3 (patch)
tree8c264d57d00d8346acaa49f76072c5ea06e7e188 /sys/geom/geom_kern.c
parent40b50edac393cf5770259c50d9e268b957a76878 (diff)
downloadFreeBSD-src-9c043d590896a77d5d66b978a963573a41d66ad3.zip
FreeBSD-src-9c043d590896a77d5d66b978a963573a41d66ad3.tar.gz
Use g_eventlock to protect against losing wakeups in the g_event process
and replace tsleep(9) with msleep(9) which doesn't use a timeout. The previously used timeout caused the event process to wake up ten times per second on an idle system. one_event() is now called with the topology lock held and it returns with both the topology and event locks held when there are no more events in the queue. Reported by: mav, Marius NĂ¼nnerich Reviewed by: freebsd-geom
Diffstat (limited to 'sys/geom/geom_kern.c')
-rw-r--r--sys/geom/geom_kern.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c
index fc4e245..5e7e274 100644
--- a/sys/geom/geom_kern.c
+++ b/sys/geom/geom_kern.c
@@ -137,10 +137,8 @@ g_event_procbody(void)
thread_lock(tp);
sched_prio(tp, PRIBIO);
thread_unlock(tp);
- for(;;) {
- g_run_events();
- tsleep(&g_wait_event, PRIBIO, "-", hz/10);
- }
+ g_run_events();
+ /* NOTREACHED */
}
static struct kproc_desc g_event_kp = {
OpenPOWER on IntegriCloud