Re: ttydev_cdevsw has no d_purge
On Wednesday 08 August 2012 22:46:28 Ed Schouten wrote:
> Hi Hans,
>
> 2012/8/8 Hans Petter Selasky <hselasky@c2i.net>:
> > Are you sure that the new softc won't be used in any callbacks when
> > tty_rel_gone() is called, except for tsw_free() ?
>
> Yes. Otherwise you would have already seen a kernel panic. See
> /sys/sys/ttydevsw.h; it has assertions on the locking.
>
> > It is like a drain state, where a unit is collected for free, and then
> > committed to free state when the tsw_free() is called. In the [unlocked]
> > time in between the unit cannot be re-used.
>
> How is this different from calling alloc/free directly? Why would it
> need to go through this `drain' state?
Because multiple TTYS can share the same ucom unit, and then stuff gets more
complicated. I would then need refcounting and such to figure out when to
actually free everything. This is simply not needed.
I'll make a patch soonish to extend tty.h with a #define tty_set_softc() if
you don't mind.
--HPS
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
討論串 (同標題文章)
完整討論串 (本文為第 23 之 28 篇):