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 kernel-testers" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html