Re: 2.6.16.18 kernel freezes while pppd is exiting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In-Reply-To: <[email protected]>

On Mon, 12 Jun 2006 10:07:10 -0500, Paul Fulghum wrote:

> Here is a patch to serialize flush_to_ldisc
> with per device granularity. It should fix the
> corruption of the free list that is the probably
> cause of the freeze you are seeing. Test it to
> see if there are any ill effects (it works fine here
> on an AMD x2 SMP kernel). I realize that
> the problem happens infrequently, so you won't
> be able to tell quickly if it fixed the freeze.

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.



Check for infinite loops in tty_buffer_free_all().  Hangs have only
been seen in the second loop, but check both anyway.

Signed-off-by: Chuck Ebbert <[email protected]>

--- 2.6.16.20-d4.orig/drivers/char/tty_io.c
+++ 2.6.16.20-d4/drivers/char/tty_io.c
@@ -240,11 +240,23 @@ static int check_tty_count(struct tty_st
 static void tty_buffer_free_all(struct tty_struct *tty)
 {
 	struct tty_buffer *thead;
+	int free_loops;
+
+	free_loops = 0;
 	while((thead = tty->buf.head) != NULL) {
+		if (++free_loops > 9999) {
+			WARN_ON(1);
+			break;
+		}
 		tty->buf.head = thead->next;
 		kfree(thead);
 	}
+	free_loops = 0;
 	while((thead = tty->buf.free) != NULL) {
+		if (++free_loops > 9999) {
+			WARN_ON(1);
+			break;
+		}
 		tty->buf.free = thead->next;
 		kfree(thead);
 	}
-- 
Chuck
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux