From 5142c0024bb36e03f8cca49322fe84f7df8f3287 Mon Sep 17 00:00:00 2001 From: dlg Date: Mon, 5 Jan 2015 23:54:18 +0000 Subject: [PATCH] splassert on some archs (or just sparc64) check that you're not in an interrupt handler at an ipl level higher than what you're splasserting you should be at. if you think code should be protected by IPL_BIO and its entered from an interrupt handler established at IPL_NET, you have a bug. add some asserts to gets and puts so we can pick those cases up. --- sys/kern/subr_pool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index 678e93ab9b8..602ff4796e6 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.176 2015/01/04 08:54:01 dlg Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.177 2015/01/05 23:54:18 dlg Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -536,6 +536,9 @@ pool_do_get(struct pool *pp, int flags, int *slowdown) MUTEX_ASSERT_LOCKED(&pp->pr_mtx); + if (pp->pr_ipl != -1) + splassert(pp->pr_ipl); + /* * Account for this item now to avoid races if we need to give up * pr_mtx to allocate a page. @@ -627,6 +630,9 @@ pool_put(struct pool *pp, void *v) mtx_enter(&pp->pr_mtx); + if (pp->pr_ipl != -1) + splassert(pp->pr_ipl); + ph = pr_find_pagehead(pp, v); #ifdef DIAGNOSTIC -- 2.20.1