From mboxrd@z Thu Jan 1 00:00:00 1970 From: OGAWA Hirofumi Subject: Re: [Bug #14388] keyboard under X with 2.6.31 Date: Fri, 16 Oct 2009 07:29:41 +0900 Message-ID: <87ljjce1ey.fsf@devron.myhome.or.jp> References: <56acieJJ2fF.A.nEB.Hzl0KB@chimera> <87ljjgfcbu.fsf@spindle.srvr.nix> <4AD3F769.5080405@gmail.com> <4AD437F9.9020708@yahoo.co.uk> <4AD4DE4C.4010402@yahoo.co.uk> <4AD4F548.2030506@microgate.com> <1255478932.19056.24.camel@localhost.localdomain> <4AD51D6B.7010509@microgate.com> <20091014125846.1a3c8d40@lxorguk.ukuu.org.uk> <87aazsh80x.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Return-path: In-Reply-To: (Linus Torvalds's message of "Thu, 15 Oct 2009 14:49:56 -0700 (PDT)") Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Linus Torvalds Cc: Alan Cox , Oleg Nesterov , Paul Fulghum , Boyan , "Rafael J. Wysocki" , Linux Kernel Mailing List , Kernel Testers List , Dmitry Torokhov , Ed Tomlinson Linus Torvalds writes: > On Fri, 16 Oct 2009, OGAWA Hirofumi wrote: >> >> I.e. the following or something, >> >> static inline int input_available_p(struct tty_struct *tty, int amt) >> { >> int try = 0; >> >> retry: >> if (tty->icanon) { >> if (tty->canon_data) >> return 1; >> } else if (tty->read_cnt >= (amt ? amt : 1)) >> return 1; >> >> if (!checked) { >> tty_flush_to_ldisc(tty); >> try = 1; >> goto retry; >> } >> >> return 0; >> } > > Yeah, we could do that. Especially if we ever see this in any profiles. I > doubt we do, but.. Yes. Or, FWIW, I was thinking to delete schedule_delayed_work() for n_tty with flag or something at previous time. I.e. disable background flush_to_ldisc() by writer for n_tty, only n_tty_read() will check tty.buf synchronously. So, with it, unnecessary flush_to_ldisc() is removed completely... Well... Thanks. -- OGAWA Hirofumi