diff options
| author | ozaki-r <ozaki-r@NetBSD.org> | 2014-11-22 15:00:05 +0000 |
|---|---|---|
| committer | ozaki-r <ozaki-r@NetBSD.org> | 2014-11-22 15:00:05 +0000 |
| commit | 2e5f2f50f3b62801e60179db4b0f1d7c7c498c70 (patch) | |
| tree | bc703aeeba725222e13d061567f6497bc99e0fc1 /sys/dev/sysmon | |
| parent | 9dab4a67199f6aaf6e732c043197a00f4d4e43f6 (diff) | |
Kill sme_callout_mtx and use sme_mtx instead
We can use sme_mtx for the callout as well. Actually we should do so
because sme_events_list and some other data that are touched in the
callout should be protected by sme_mtx, not sme_callout_mtx.
Discussed with riastradh@ in http://mail-index.netbsd.org/tech-kern/2014/11/11/msg017956.html
Diffstat (limited to 'sys/dev/sysmon')
| -rw-r--r-- | sys/dev/sysmon/sysmon_envsys_events.c | 10 | ||||
| -rw-r--r-- | sys/dev/sysmon/sysmonvar.h | 3 |
2 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/sysmon/sysmon_envsys_events.c b/sys/dev/sysmon/sysmon_envsys_events.c index e479bd6587f..c99da494d71 100644 --- a/sys/dev/sysmon/sysmon_envsys_events.c +++ b/sys/dev/sysmon/sysmon_envsys_events.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_envsys_events.c,v 1.110 2013/09/15 14:40:56 martin Exp $ */ +/* $NetBSD: sysmon_envsys_events.c,v 1.111 2014/11/22 15:00:05 ozaki-r Exp $ */ /*- * Copyright (c) 2007, 2008 Juan Romero Pardines. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.110 2013/09/15 14:40:56 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.111 2014/11/22 15:00:05 ozaki-r Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -566,7 +566,6 @@ sme_events_init(struct sysmon_envsys *sme) if (error) return error; - mutex_init(&sme->sme_callout_mtx, MUTEX_DEFAULT, IPL_SOFTCLOCK); callout_init(&sme->sme_callout, CALLOUT_MPSAFE); callout_setfunc(&sme->sme_callout, sme_events_check, sme); sme->sme_flags |= SME_CALLOUT_INITIALIZED; @@ -614,7 +613,6 @@ sme_events_destroy(struct sysmon_envsys *sme) callout_stop(&sme->sme_callout); workqueue_destroy(sme->sme_wq); - mutex_destroy(&sme->sme_callout_mtx); callout_destroy(&sme->sme_callout); sme->sme_flags &= ~SME_CALLOUT_INITIALIZED; DPRINTF(("%s: events framework destroyed for '%s'\n", @@ -708,14 +706,14 @@ sme_events_check(void *arg) KASSERT(sme != NULL); - mutex_enter(&sme->sme_callout_mtx); + mutex_enter(&sme->sme_mtx); LIST_FOREACH(see, &sme->sme_events_list, see_list) { workqueue_enqueue(sme->sme_wq, &see->see_wk, NULL); see->see_edata->flags |= ENVSYS_FNEED_REFRESH; } if (!sysmon_low_power) sme_schedule_callout(sme); - mutex_exit(&sme->sme_callout_mtx); + mutex_exit(&sme->sme_mtx); } /* diff --git a/sys/dev/sysmon/sysmonvar.h b/sys/dev/sysmon/sysmonvar.h index 4085a1e517d..7634afa3546 100644 --- a/sys/dev/sysmon/sysmonvar.h +++ b/sys/dev/sysmon/sysmonvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: sysmonvar.h,v 1.44 2012/12/11 15:39:06 pgoyette Exp $ */ +/* $NetBSD: sysmonvar.h,v 1.45 2014/11/22 15:00:05 ozaki-r Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -208,7 +208,6 @@ struct sysmon_envsys { * Locking/synchronization. */ kmutex_t sme_mtx; - kmutex_t sme_callout_mtx; kcondvar_t sme_condvar; }; |
