diff options
| author | Mateusz Guzik <mjg@FreeBSD.org> | 2020-11-05 12:24:37 +0000 |
|---|---|---|
| committer | Mateusz Guzik <mjg@FreeBSD.org> | 2020-11-05 12:24:37 +0000 |
| commit | ea33cca9717d4b787768c6f06c0e3cb34fb8eabb (patch) | |
| tree | 913c3427669a6dcb5bd04b5bc7bc5413a68d8e4e /sys | |
| parent | 2fbb45c601241c6142f3332efa3844512f49eef2 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/sys_generic.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index fa66490969c4..8f0063157d74 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -159,7 +159,7 @@ struct selfd { u_int sf_refs; }; -static uma_zone_t selfd_zone; +MALLOC_DEFINE(M_SELFD, "selfd", "selfd"); static struct mtx_pool *mtxpool_select; #ifdef __LP64__ @@ -1691,11 +1691,11 @@ selfdalloc(struct thread *td, void *cookie) stp = td->td_sel; if (stp->st_free1 == NULL) - stp->st_free1 = uma_zalloc(selfd_zone, M_WAITOK|M_ZERO); + stp->st_free1 = malloc(sizeof(*stp->st_free1), M_SELFD, M_WAITOK|M_ZERO); stp->st_free1->sf_td = stp; stp->st_free1->sf_cookie = cookie; if (stp->st_free2 == NULL) - stp->st_free2 = uma_zalloc(selfd_zone, M_WAITOK|M_ZERO); + stp->st_free2 = malloc(sizeof(*stp->st_free2), M_SELFD, M_WAITOK|M_ZERO); stp->st_free2->sf_td = stp; stp->st_free2->sf_cookie = cookie; } @@ -1713,7 +1713,7 @@ selfdfree(struct seltd *stp, struct selfd *sfp) mtx_unlock(sfp->sf_mtx); } if (refcount_release(&sfp->sf_refs)) - uma_zfree(selfd_zone, sfp); + free(sfp, M_SELFD); } /* Drain the waiters tied to all the selfd belonging the specified selinfo. */ @@ -1827,7 +1827,7 @@ doselwakeup(struct selinfo *sip, int pri) cv_broadcastpri(&stp->st_wait, pri); mtx_unlock(&stp->st_mtx); if (refcount_release(&sfp->sf_refs)) - uma_zfree(selfd_zone, sfp); + free(sfp, M_SELFD); } mtx_unlock(sip->si_mtx); } @@ -1888,9 +1888,9 @@ seltdfini(struct thread *td) if (stp == NULL) return; if (stp->st_free1) - uma_zfree(selfd_zone, stp->st_free1); + free(stp->st_free1, M_SELFD); if (stp->st_free2) - uma_zfree(selfd_zone, stp->st_free2); + free(stp->st_free2, M_SELFD); td->td_sel = NULL; cv_destroy(&stp->st_wait); mtx_destroy(&stp->st_mtx); @@ -1920,8 +1920,6 @@ static void selectinit(void *dummy __unused) { - selfd_zone = uma_zcreate("selfd", sizeof(struct selfd), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); mtxpool_select = mtx_pool_create("select mtxpool", 128, MTX_DEF); } |
