Re: [Bug #14388] keyboard under X with 2.6.31
From: Paul Fulghum
Date: Tue Oct 13 2009 - 11:10:37 EST
On Tue, 2009-10-13 at 07:39 -0700, Linus Torvalds wrote:
> You also can race with:
>
> - whoever is _reading_ the buffer, and due to memory ordering may see the
> update to the buffer length _before_ it actually sees the data itself.
> That spinlock does all the memory ordering too.
The only reader is flush_to_ldisc() which operates on the
'commit' and 'read' fields of the buffer.
tty_prepare_xxx and tty_insert_xxx operate on the 'used'
field of the buffer
'commit' is updated with 'used' only under spinlock when
tty_flip_buffer_push() is called after the producer is
finished filling a buffer or in tty_buffer_request_room()
when allocating a new buffer.
--
Paul Fulghum
Microgate Systems, Ltd
--
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/