Re: PATCH: tty locking for 2.6.9rc2

From: Paul Fulghum
Date: Wed Sep 15 2004 - 11:34:36 EST


On Tue, 2004-09-14 at 11:34, Alan Cox wrote:
> This updates the ldisc locking patch for the 2.6.9rc2 changes.

I tried this patch and can't change line disciplines.
The user program waits forever on ioctl(TIOCSETD).
I am going to add printk statements to
find out more.

Looking at your patch I have a question:

Each line discipline has a refcount.
This single refcount is modified by all
entities using that line discipline.

tty_set_ldisc() in tty_io.c waits until the
old ldisc refcount goes to zero before setting
the new ldisc. This seems to cause a problem
in the following situation:

1. two tty instances start with the same ldisc
2. first tty instance holds reference to ldisc
3. second tty instance tries to change ldisc

The second tty instance must wait for the first
tty instance to drop the ldisc reference before
it can change to a new ldisc.

Each tty instance should be able to change
line discipline independant of other tty instances.

Or am I not understanding this correctly?

--
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/