From e4faf55ba7e29e98f15a74862c1a34e819895f96 Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Mon, 24 Aug 2015 14:28:26 +0000 Subject: Items from pool sosplice_pool are get in process context and put in soft interrupt. So the pool needs an IPL_SOFTNET protection. This fixes a panic: mtx_enter: locking against myself. While there, call pool_setipl() also for socket_pool. Although this pool uses explicit spl protection around pool_get() and pool_put(), it is better to specify the IPL it is operating on. OK mpi@ mikeb@ --- sys/kern/uipc_socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index cc8b477c3e3..379020389cb 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.141 2015/07/08 07:21:50 mpi Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.142 2015/08/24 14:28:25 bluhm Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -86,11 +86,12 @@ struct pool sosplice_pool; void soinit(void) { - pool_init(&socket_pool, sizeof(struct socket), 0, 0, 0, "sockpl", NULL); + pool_setipl(&socket_pool, IPL_SOFTNET); #ifdef SOCKET_SPLICE pool_init(&sosplice_pool, sizeof(struct sosplice), 0, 0, 0, "sosppl", NULL); + pool_setipl(&sosplice_pool, IPL_SOFTNET); #endif } -- cgit v1.2.3