Source-Changes-HG archive

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

[src/prg-localcount2]: src/sys/kern Use kpreempt_{dis, en}able() rather than s...



details:   https://anonhg.NetBSD.org/src/rev/bf0d1d7cd105
branches:  prg-localcount2
changeset: 823538:bf0d1d7cd105
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Thu May 11 21:31:12 2017 +0000

description:
Use kpreempt_{dis,en}able() rather than splsoftserial() for blocking
the local execution of the low-priority xcall.

Thanks to Kengo NAKAHARA for pointing this out.

diffstat:

 sys/kern/subr_localcount.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 2f79ddacd8b7 -r bf0d1d7cd105 sys/kern/subr_localcount.c
--- a/sys/kern/subr_localcount.c        Thu May 11 02:58:28 2017 +0000
+++ b/sys/kern/subr_localcount.c        Thu May 11 21:31:12 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_localcount.c,v 1.1.6.3 2017/05/02 03:19:22 pgoyette Exp $ */
+/*     $NetBSD: subr_localcount.c,v 1.1.6.4 2017/05/11 21:31:12 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_localcount.c,v 1.1.6.3 2017/05/02 03:19:22 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_localcount.c,v 1.1.6.4 2017/05/11 21:31:12 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/localcount.h>
@@ -215,7 +215,6 @@
 void
 localcount_release(struct localcount *lc, kcondvar_t *cv, kmutex_t *interlock)
 {
-       int s;
 
        /*
         * Block xcall so that if someone begins draining after we see
@@ -227,7 +226,7 @@
         * lc->lc_totalp as null, this CPU will not wake
         * localcount_drain.
         */
-       s = splsoftserial();
+       kpreempt_disable();
 
        KDASSERT(mutex_ownable(interlock));
        if (__predict_false(lc->lc_totalp != NULL)) {
@@ -245,5 +244,5 @@
        }
 
        localcount_adjust(lc, -1);
-out:   splx(s);
+ out:  kpreempt_enable();
 }



Home | Main Index | Thread Index | Old Index