Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Use high priority xcall with a softint of an IPL th...



details:   https://anonhg.NetBSD.org/src/rev/8ff2dfe9b10c
branches:  trunk
changeset: 359141:8ff2dfe9b10c
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Feb 01 03:17:00 2018 +0000

description:
Use high priority xcall with a softint of an IPL the same as psref class's one

This mitigates undesired delay of psref_target_destroy under load such as heavy
netowrk traffic that loads softint.

diffstat:

 sys/kern/subr_psref.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r 476b0c7e91f6 -r 8ff2dfe9b10c sys/kern/subr_psref.c
--- a/sys/kern/subr_psref.c     Thu Feb 01 03:15:28 2018 +0000
+++ b/sys/kern/subr_psref.c     Thu Feb 01 03:17:00 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_psref.c,v 1.10 2017/12/28 03:39:48 msaitoh Exp $  */
+/*     $NetBSD: subr_psref.c,v 1.11 2018/02/01 03:17:00 ozaki-r Exp $  */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_psref.c,v 1.10 2017/12/28 03:39:48 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_psref.c,v 1.11 2018/02/01 03:17:00 ozaki-r Exp $");
 
 #include <sys/types.h>
 #include <sys/condvar.h>
@@ -94,6 +94,7 @@
        kcondvar_t              prc_cv;
        struct percpu           *prc_percpu; /* struct psref_cpu */
        ipl_cookie_t            prc_iplcookie;
+       unsigned int            prc_xc_flags;
 };
 
 /*
@@ -124,6 +125,7 @@
        mutex_init(&class->prc_lock, MUTEX_DEFAULT, ipl);
        cv_init(&class->prc_cv, name);
        class->prc_iplcookie = makeiplcookie(ipl);
+       class->prc_xc_flags = XC_HIGHPRI_IPL(ipl);
 
        return class;
 }
@@ -434,7 +436,8 @@
                 * Ask all CPUs to say whether they hold a psref to the
                 * target.
                 */
-               xc_wait(xc_broadcast(0, &psreffed_p_xc, &P, NULL));
+               xc_wait(xc_broadcast(class->prc_xc_flags, &psreffed_p_xc, &P,
+                                    NULL));
        } else
                psreffed_p_xc(&P, NULL);
 



Home | Main Index | Thread Index | Old Index