Re: PATCH: tty drivers take two

From: Paul Fulghum
Date: Thu Sep 16 2004 - 12:55:35 EST


On Thu, 2004-09-16 at 11:45, Alan Cox wrote:
> I was looking at that but some of them do the wakeup before and
> some after and I've not had time to figure out if the order ever
> matters

I don't see the order mattering as far as breaking things,
but might matter a little for performance.
(depending on the particular ldisc implementation)

wake_up_interruptible(&tty->write_wait) should
come after the ldisc write_wakeup (as is done in tty_io.c)
so that send data buffered by the ldisc
can be sent to the driver before trying to process
more send data from a sleeping user context.

The various serial drivers make the two calls for
the same reason: the driver has become capable of
accepting more data. That the drivers make the
calls in different order points back to the
order not mattering for strictly functional purposes.

*BUT*

You made a statement about reworking tty locking
one step at a time, and concentrating on the ldisc
locking first.

In that light, it might be better to factor out the
wake_up_interruptible(&tty->write_wait) calls
after the ldisc locking is complete and integrated.

--
Paul Fulghum
paulkf@xxxxxxxxxxxxx

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/