From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Fulghum Subject: Re: [Bug #14388] keyboard under X with 2.6.31 Date: Tue, 13 Oct 2009 10:08:51 -0500 Message-ID: <1255446531.3423.8.camel@x2.microgate.com> References: <56acieJJ2fF.A.nEB.Hzl0KB@chimera> <87ljjgfcbu.fsf@spindle.srvr.nix> <20091013113232.384b2432@lxorguk.ukuu.org.uk> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: kernel-testers-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Linus Torvalds Cc: Alan Cox , Nix , "Justin P. Mattock" , "Rafael J. Wysocki" , Linux Kernel Mailing List , Kernel Testers List , Boyan , Dmitry Torokhov , Ed Tomlinson , "=?ISO-8859-1?Q?Fr=E9d=E9ric?= L. W. Meunier" , OGAWA Hirofumi 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