Right now, setting devctl_queue=0 destroys the devctl UMA zone, which
can't be recreated. Avoid that when stopping devd, since this prevents
devd from being started again without a reboot.
PR: 283708
Differential D48423
devd: Avoid setting devctl_queue when stopping devd markj on Fri, Jan 10, 8:37 PM. Authored by Tags None Referenced Files
Subscribers None
Details
Diff Detail
Event TimelineComment Actions diff --git a/sys/kern/kern_devctl.c b/sys/kern/kern_devctl.c index d83bc380c2fe..6df120792b08 100644 --- a/sys/kern/kern_devctl.c +++ b/sys/kern/kern_devctl.c @@ -560,18 +560,20 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) } /* - * XXX It's hard to grow or shrink the UMA zone. Only allow - * disabling the queue size for the moment until underlying - * UMA issues can be sorted out. + * At runtime, though, it's hard to grow or shrink the UMA + * zone. Only allow toggling between zero and the initially + * configured size. The queue size itself isn't settable at + * runtime. If we were disabled at boot, we can't change + * anything. */ - if (q != 0) + if (devsoftc.zone == NULL) + return (EINVAL); + if (q != 0 && q != uma_zone_get_max(devsoftc.zone)) return (EINVAL); if (q == devctl_queue_length) return (0); mtx_lock(&devsoftc.mtx); - devctl_queue_length = 0; - uma_zdestroy(devsoftc.zone); - devsoftc.zone = 0; + devctl_queue_length = q; mtx_unlock(&devsoftc.mtx); return (0); } I think will do the trick. I've only lightly tested it though.
|