[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0910130934070.26777@localhost.localdomain>
Date: Tue, 13 Oct 2009 09:42:39 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
cc: Paul Fulghum <paulkf@...rogate.com>, Nix <nix@...eri.org.uk>,
"Justin P. Mattock" <justinmattock@...il.com>,
"Rafael J. Wysocki" <rjw@...k.pl>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kernel Testers List <kernel-testers@...r.kernel.org>,
Boyan <btanastasov@...oo.co.uk>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Ed Tomlinson <edt@....ca>,
Frédéric L. W. Meunier
<fredlwm@...il.com>, OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Subject: Re: [Bug #14388] keyboard under X with 2.6.31
On Tue, 13 Oct 2009, Alan Cox wrote:
>
> I actually think you should make the tty_insert_flip_string internal
> length checking change because:
> - It makes the consistency of tty_insert_flip_string clearer to any
> future reader
It does that, although then you're still stuck looking at the (few)
tty_prepare_flip_*() calls that have that "racy feel".
But there aren't _that_ many callers, and it would probably be easier to
at least comment on those.
> - It's a very very mindbogglingly slight performance win
I suspect the loop is always done exactly once in practice, so I'm not
sure it will matter for performance one way or the other.
However, if we do hold the spinlock over the whole operation, what we
_could_ do is to then just combine it with tty_flip_buffer_push(), and do
that
tb->commit = tb->used;
part inside the lock. There's a number of people who effectively do
tty_tty_buffer_request_room(tty, size);
tty_insert_flip_string(tty, buffer, size);
tty_flip_buffer_push(tty);
and that just takes that silly spinlock _three_ times for no good reason.
> - It'll no doubt make you feel less grumpy ;)
Not likely. Grumpy is my baseline.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists