diff --git a/sys/kern/subr_psref.c b/sys/kern/subr_psref.c index f4bb92a7057b..6032ff3eac01 100644 --- a/sys/kern/subr_psref.c +++ b/sys/kern/subr_psref.c @@ -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 -__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 #include @@ -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 ipl) 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, struct psref_class *class) * 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);