public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Fulghum <paulkf@microgate.com>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: 2.6.16.18 kernel freezes while pppd is exiting
Date: Mon, 12 Jun 2006 13:06:12 -0500	[thread overview]
Message-ID: <1150135572.6065.8.camel@amdx2.microgate.com> (raw)
In-Reply-To: <200606121239_MC3-1-C23E-9AF9@compuserve.com>

On Mon, 2006-06-12 at 12:36 -0400, Chuck Ebbert wrote:
> I already applied this, which should keep it from freezing and
> will print a warning, so I will apply your patch and then check
> the log every time pppd exits.

Your debug output seems like a good idea for catching
the mechanism of reentrance on flush_to_ldisc (if it
is happening at all).

My reading of the workqueue code is that the work
function can run in parallel on a multiple CPU
system. The default workqueue has multiple, per
CPU queues, and the pending bit for the
work item is cleared before execution. This would
allow the work item to be requeued for another CPU
while the function is executing.
(If I'm wrong, I would be happy to be told why)

Anyways, if I can impose on you to use this version
with debug output, it would help clarify this.

If the DONT_FLIP debug output happens too often and
fills you syslog, comment out that part.

--- a/include/linux/tty.h	2006-06-09 09:33:16.000000000 -0500
+++ b/include/linux/tty.h	2006-06-12 09:22:10.000000000 -0500
@@ -267,6 +267,7 @@ struct tty_struct {
 #define TTY_PTY_LOCK 		16	/* pty private */
 #define TTY_NO_WRITE_SPLIT 	17	/* Preserve write boundaries to driver */
 #define TTY_HUPPED 		18	/* Post driver->hangup() */
+#define TTY_FLUSHING 		19	/* Flushing tty buffers to line discipline */
 
 #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
 
--- a/drivers/char/tty_io.c	2006-06-12 12:54:37.000000000 -0500
+++ b/drivers/char/tty_io.c	2006-06-12 12:54:54.000000000 -0500
@@ -2786,9 +2786,12 @@ static void flush_to_ldisc(void *private
 		return;
 
 	if (test_bit(TTY_DONT_FLIP, &tty->flags)) {
-		/*
-		 * Do it after the next timer tick:
-		 */
+		printk(KERN_ERR"flush_to_ldisc - TTY_DONT_FLIP set\n");
+		schedule_delayed_work(&tty->buf.work, 1);
+		goto out;
+	}
+	if (test_and_set_bit(TTY_FLUSHING, &tty->flags)) {
+		printk(KERN_ERR"flush_to_ldisc - TTY_FLUSHING set, low_latency=%d\n", tty->low_latency);
 		schedule_delayed_work(&tty->buf.work, 1);
 		goto out;
 	}
@@ -2810,6 +2813,7 @@ static void flush_to_ldisc(void *private
 		tty_buffer_free(tty, tbuf);
 	}
 	spin_unlock_irqrestore(&tty->buf.lock, flags);
+	clear_bit(TTY_FLUSHING, &tty->flags);
 out:
 	tty_ldisc_deref(disc);
 }



  reply	other threads:[~2006-06-12 18:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-12 16:36 2.6.16.18 kernel freezes while pppd is exiting Chuck Ebbert
2006-06-12 18:06 ` Paul Fulghum [this message]
2006-06-12 18:11 ` Paul Fulghum
  -- strict thread matches above, loose matches on Subject: below --
2006-06-08 23:07 Chuck Ebbert
2006-06-09 13:35 ` Paul Fulghum
2006-06-12 15:07 ` Paul Fulghum
2006-06-12 15:53   ` Alan Cox
2006-06-12 16:11     ` Paul Fulghum
2006-06-12 16:36       ` Alan Cox
2006-06-12 16:25         ` Paul Fulghum
2006-06-08 18:09 Chuck Ebbert
2006-06-08 20:08 ` Paul Fulghum
2006-06-08 21:17 ` Paul Fulghum

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=1150135572.6065.8.camel@amdx2.microgate.com \
    --to=paulkf@microgate.com \
    --cc=76306.1226@compuserve.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.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