summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2015-01-05 23:54:19 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2015-01-05 23:54:19 +0000
commit8579e5fc251891449b3073f331fcb4fd8110f47c (patch)
tree9dd45c64aca6aa7fa109fa79515916165848ffd9 /sys/kern
parentaa2fef782dd26415df1f36bb0818a10082e4bc40 (diff)
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.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_pool.c8
1 files changed, 7 insertions, 1 deletions
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