mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Peter Volkov <pva@gentoo.org>
Cc: gregkh@suse.de, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.31 regression: system hang after pptp connection established
Date: Thu, 17 Sep 2009 14:12:39 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0909171359210.4950@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.01.0909171327230.4950@localhost.localdomain>



On Thu, 17 Sep 2009, Linus Torvalds wrote:
> 
> What's interesting about it is that it shows a problem, but the problem it 
> shows would seem to have nothing at all to do with ppp or networking or 
> pty's. The problem seems to be processes stuck in disk-wait:

Ahh. I think I see what may be going on.

Somebody got a filesystem mutex, and then went to sleep due to IO. Then 
pptp comes in, and seems to be stuck in a loop in kernel space, and 
it seems to be stuck with preemption off.

So one CPU is stuck, and the thing that we want to run is on the same 
run-queue, and not preempting. An looking at your CPU#1 trace, it's likely 
looping in ppp_async_push().

And that whole loop is insane (and very prone to infinite loops), but it 
also depends on that tty wakeup() thing.

Does this patch make a difference? Make sure to _not_ try to do the whole 
wakeup thing if we couldn't actually insert anything into the tty buffers.

		Linus
---
 drivers/char/pty.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index b33d668..53761ce 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -120,8 +120,10 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
 		/* Stuff the data into the input queue of the other end */
 		c = tty_insert_flip_string(to, buf, c);
 		/* And shovel */
-		tty_flip_buffer_push(to);
-		tty_wakeup(tty);
+		if (c) {
+			tty_flip_buffer_push(to);
+			tty_wakeup(tty);
+		}
 	}
 	return c;
 }

  reply	other threads:[~2009-09-17 21:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17 19:59 Peter Volkov
2009-09-17 20:42 ` Linus Torvalds
2009-09-17 21:12   ` Linus Torvalds [this message]
2009-09-18 11:20     ` Peter Volkov
2009-09-18 14:16       ` Linus Torvalds
2009-09-18 15:37 ` Andrey Rahmatullin
2009-09-18 15:48   ` Linus Torvalds

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=alpine.LFD.2.01.0909171359210.4950@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pva@gentoo.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

Powered by JetHome