Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 Don't hold softnet_lock in mld_timeo



details:   https://anonhg.NetBSD.org/src/rev/3de0b47d4f8a
branches:  trunk
changeset: 362150:3de0b47d4f8a
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue May 29 04:35:28 2018 +0000

description:
Don't hold softnet_lock in mld_timeo

Then we can get rid of remaining abuses of mutex_owned(softnet_lock).

diffstat:

 sys/netinet6/mld6.c |  19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diffs (61 lines):

diff -r 23afb31c9f3f -r 3de0b47d4f8a sys/netinet6/mld6.c
--- a/sys/netinet6/mld6.c       Tue May 29 03:38:24 2018 +0000
+++ b/sys/netinet6/mld6.c       Tue May 29 04:35:28 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mld6.c,v 1.92 2018/05/01 07:21:39 maxv Exp $   */
+/*     $NetBSD: mld6.c,v 1.93 2018/05/29 04:35:28 ozaki-r Exp $        */
 /*     $KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $   */
 
 /*
@@ -102,7 +102,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.92 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.93 2018/05/29 04:35:28 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -221,10 +221,7 @@
 
        rw_exit(&in6_multilock);
 
-       if (mutex_owned(softnet_lock))
-               callout_halt(&in6m->in6m_timer_ch, softnet_lock);
-       else
-               callout_halt(&in6m->in6m_timer_ch, NULL);
+       callout_halt(&in6m->in6m_timer_ch, NULL);
 
        rw_enter(&in6_multilock, RW_WRITER);
 
@@ -238,7 +235,7 @@
 
        KASSERT(in6m->in6m_refcount > 0);
 
-       SOFTNET_KERNEL_LOCK_UNLESS_NET_MPSAFE();
+       KERNEL_LOCK_UNLESS_NET_MPSAFE();
        rw_enter(&in6_multilock, RW_WRITER);
        if (in6m->in6m_timer == IN6M_TIMER_UNDEF)
                goto out;
@@ -256,7 +253,7 @@
 
 out:
        rw_exit(&in6_multilock);
-       SOFTNET_KERNEL_UNLOCK_UNLESS_NET_MPSAFE();
+       KERNEL_UNLOCK_UNLESS_NET_MPSAFE();
 }
 
 static u_long
@@ -805,10 +802,8 @@
 
        /* Tell mld_timeo we're halting the timer */
        in6m->in6m_timer = IN6M_TIMER_UNDEF;
-       if (mutex_owned(softnet_lock))
-               callout_halt(&in6m->in6m_timer_ch, softnet_lock);
-       else
-               callout_halt(&in6m->in6m_timer_ch, NULL);
+
+       callout_halt(&in6m->in6m_timer_ch, NULL);
        callout_destroy(&in6m->in6m_timer_ch);
 
        free(in6m, M_IPMADDR);



Home | Main Index | Thread Index | Old Index