mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Guillaume Chazarain <guichaz@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	gregkh@suse.de,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Felipe Balbi <balbi@ti.com>, Tejun Heo <tj@kernel.org>
Subject: Re: tty breakage in X (Was: tty vs workqueue oddities)
Date: Wed, 8 Jun 2011 11:28:28 +0300	[thread overview]
Message-ID: <20110608082827.GE11187@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <BANLkTikt1ZZNC1YffT_bRAX6GwjWDk_T3Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]

Hi,

On Tue, Jun 07, 2011 at 07:44:48PM -0700, Linus Torvalds wrote:
> On Mon, Jun 6, 2011 at 7:24 AM, Guillaume Chazarain <guichaz@gmail.com> wrote:
> >
> > After reverting http://git.kernel.org/linus/a5660b4 "tty: fix endless
> > work loop when the buffer fills up" I cannot reproduce the hangs on
> > SMP anymore but it brings back the busy loop on UP.
> 
> Hmm. The n_tty layer has some rather distressing locking, and doesn't
> lock "tty->receive_room" changes at all, for example (and uses
> multiple locks for some other things).
> 
> It may well be that there is some SMP race there. The n_tty line
> discipline has its own locking for its counts, and the tty buffer code
> has its own locking, and "receive_room" kind o fends up being in the
> middle between them.
> 
> The sad part is that the patch that made receive_buf() return the
> amout of bytes received was actually trying to do the right thing, it
> just did it entirely in the wrong way (re-introducing the crazy
> re-arming of the workqueue from within itself, and using all the wrong
> sign issues).

yeah sorry about that. I originally wrote that patch over one year ago
and had to send it three times until it was finally noticed. Then I had
to do a quick rebase and things went pretty bad.

Should've checked better and forget about loosing another merge window.

> I'd love to get rid of receive_room entirely - and just letting the
> tty line discipline handler say how much it actually received. in
> other words, having receive_buf() just tell us how much it used, and
> not looking at receive_room in the caller is absolutely the right
> thing.

that was the idea, unfortunately I missed the last part. Sorry about
that.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2011-06-08  8:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-02  7:17 tty vs workqueue oddities Benjamin Herrenschmidt
2011-06-02  8:37 ` tty breakage in X (Was: tty vs workqueue oddities) Benjamin Herrenschmidt
2011-06-02  9:30   ` Andreas Schwab
2011-06-02 10:07   ` Alan Cox
2011-06-03  0:56     ` Benjamin Herrenschmidt
2011-06-03  6:17       ` Benjamin Herrenschmidt
2011-06-03  6:56         ` Benjamin Herrenschmidt
2011-06-03  9:36           ` Linus Torvalds
2011-06-05 14:37             ` Guillaume Chazarain
2011-06-06 14:24               ` Guillaume Chazarain
2011-06-08  2:44                 ` Linus Torvalds
2011-06-08  3:31                   ` Linus Torvalds
2011-06-08  8:31                     ` Guillaume Chazarain
2011-06-08  8:28                   ` Felipe Balbi [this message]
2011-06-08  9:04                   ` Alan Cox
2011-06-02 10:03 ` tty vs workqueue oddities Alan Cox
2011-06-03 10:23 tty breakage in X (Was: tty vs workqueue oddities) Milton Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110608082827.GE11187@legolas.emea.dhcp.ti.com \
    --to=balbi@ti.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=gregkh@suse.de \
    --cc=guichaz@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®