pools lock themselves, we just gotta tell them how hard. can someone test this with ipsec or softraid crypto? or ok it?
Index: crypto.c =================================================================== RCS file: /cvs/src/sys/crypto/crypto.c,v retrieving revision 1.68 diff -u -p -r1.68 crypto.c --- crypto.c 20 Oct 2014 00:40:33 -0000 1.68 +++ crypto.c 20 Oct 2014 00:46:44 -0000 @@ -453,20 +453,16 @@ void crypto_freereq(struct cryptop *crp) { struct cryptodesc *crd; - int s; if (crp == NULL) return; - s = splvm(); - while ((crd = crp->crp_desc) != NULL) { crp->crp_desc = crd->crd_next; pool_put(&cryptodesc_pool, crd); } pool_put(&cryptop_pool, crp); - splx(s); } /* @@ -477,20 +473,14 @@ crypto_getreq(int num) { struct cryptodesc *crd; struct cryptop *crp; - int s; - s = splvm(); - crp = pool_get(&cryptop_pool, PR_NOWAIT | PR_ZERO); - if (crp == NULL) { - splx(s); + if (crp == NULL) return NULL; - } while (num--) { crd = pool_get(&cryptodesc_pool, PR_NOWAIT | PR_ZERO); if (crd == NULL) { - splx(s); crypto_freereq(crp); return NULL; } @@ -499,7 +489,6 @@ crypto_getreq(int num) crp->crp_desc = crd; } - splx(s); return crp; } @@ -510,8 +499,10 @@ crypto_init(void) pool_init(&cryptop_pool, sizeof(struct cryptop), 0, 0, 0, "cryptop", NULL); + pool_setipl(&cryptop_pool, IPL_VM); pool_init(&cryptodesc_pool, sizeof(struct cryptodesc), 0, 0, 0, "cryptodesc", NULL); + pool_setipl(&cryptodesc_pool, IPL_VM); } /*