Module Name:    src
Committed By:   ozaki-r
Date:           Thu Feb  1 03:17:00 UTC 2018

Modified Files:
        src/sys/kern: subr_psref.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/kern/subr_psref.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_psref.c
diff -u src/sys/kern/subr_psref.c:1.10 src/sys/kern/subr_psref.c:1.11
--- src/sys/kern/subr_psref.c:1.10	Thu Dec 28 03:39:48 2017
+++ src/sys/kern/subr_psref.c	Thu Feb  1 03:17:00 2018
@@ -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 @@ struct psref_class {
 	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 @@ psref_class_create(const char *name, int
 	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 @@ psreffed_p(struct psref_target *target, 
 		 * 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);
 

Reply via email to