Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/tprof tprof_lock is not a spin mutex. use mutex_{ent...



details:   https://anonhg.NetBSD.org/src/rev/44ea38a9d7ec
branches:  trunk
changeset: 372656:44ea38a9d7ec
user:      ryo <ryo%NetBSD.org@localhost>
date:      Fri Dec 16 17:38:56 2022 +0000

description:
tprof_lock is not a spin mutex. use mutex_{enter,exit}(). oops

diffstat:

 sys/dev/tprof/tprof.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r 0e08c3f72327 -r 44ea38a9d7ec sys/dev/tprof/tprof.c
--- a/sys/dev/tprof/tprof.c     Fri Dec 16 17:35:42 2022 +0000
+++ b/sys/dev/tprof/tprof.c     Fri Dec 16 17:38:56 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tprof.c,v 1.21 2022/12/16 07:59:42 ryo Exp $   */
+/*     $NetBSD: tprof.c,v 1.22 2022/12/16 17:38:56 ryo Exp $   */
 
 /*-
  * Copyright (c)2008,2009,2010 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tprof.c,v 1.21 2022/12/16 07:59:42 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof.c,v 1.22 2022/12/16 17:38:56 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -885,9 +885,9 @@
 static void
 filt_tprof_read_detach(struct knote *kn)
 {
-       mutex_spin_enter(&tprof_lock);
+       mutex_enter(&tprof_lock);
        selremove_knote(&tprof_selp, kn);
-       mutex_spin_exit(&tprof_lock);
+       mutex_exit(&tprof_lock);
 }
 
 static int
@@ -896,7 +896,7 @@
        int rv = 0;
 
        if ((hint & NOTE_SUBMIT) == 0)
-               mutex_spin_enter(&tprof_lock);
+               mutex_enter(&tprof_lock);
 
        if (!STAILQ_EMPTY(&tprof_list)) {
                tprof_buf_t *buf;
@@ -911,7 +911,7 @@
        }
 
        if ((hint & NOTE_SUBMIT) == 0)
-               mutex_spin_exit(&tprof_lock);
+               mutex_exit(&tprof_lock);
 
        return rv;
 }
@@ -929,9 +929,9 @@
        switch (kn->kn_filter) {
        case EVFILT_READ:
                kn->kn_fop = &tprof_read_filtops;
-               mutex_spin_enter(&tprof_lock);
+               mutex_enter(&tprof_lock);
                selrecord_knote(&tprof_selp, kn);
-               mutex_spin_exit(&tprof_lock);
+               mutex_exit(&tprof_lock);
                break;
        default:
                return EINVAL;



Home | Main Index | Thread Index | Old Index