diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-09-16 23:05:35 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-09-16 23:05:35 +0000 |
commit | a9f061219800c7609103c928eb34aacfe2101731 (patch) | |
tree | 5f4aba09c3759d4ec545c57616772d5496d464eb /sys/kern | |
parent | 4400dda36eb45362c3c8d1fa382848e3864d3bb1 (diff) |
disable taking the mutex to read pool stats.
some pool users (eg, mbufs and mbuf clusters) protect calls to pools
with their own locks that operate at high spl levels, rather than
pool_setipl() to have pools protect themselves.
this means pools mtx_enter doesnt necessarily prevent interrupts
that will use a pool, so we get code paths that try to mtx_enter
twice, which blows up.
reported by vlado at bsdbg dot net and matt bettinger
diagnosed by kettenis@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_pool.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index 8626f19682d..d0bee2ead3f 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.155 2014/09/16 21:45:12 dlg Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.156 2014/09/16 23:05:34 dlg Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -1405,7 +1405,8 @@ sysctl_dopool(int *name, u_int namelen, char *oldp, size_t *oldlenp) case KERN_POOL_POOL: memset(&pi, 0, sizeof(pi)); - mtx_enter(&pp->pr_mtx); + /* XXX can't mtx until all pools setipl correctly */ + /* mtx_enter(&pp->pr_mtx); */ pi.pr_size = pp->pr_size; pi.pr_pgsize = pp->pr_pgsize; pi.pr_itemsperpage = pp->pr_itemsperpage; @@ -1422,7 +1423,7 @@ sysctl_dopool(int *name, u_int namelen, char *oldp, size_t *oldlenp) pi.pr_npagefree = pp->pr_npagefree; pi.pr_hiwat = pp->pr_hiwat; pi.pr_nidle = pp->pr_nidle; - mtx_leave(&pp->pr_mtx); + /* mtx_leave(&pp->pr_mtx); */ rv = sysctl_rdstruct(oldp, oldlenp, NULL, &pi, sizeof(pi)); break; |