lkml.org 
[lkml]   [2004]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: PATCH: tty drivers take two
From
Date
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@microgate.com

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

\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.050 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site