public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: adi@hexapodia.org, ak@muc.de, linux-kernel@vger.kernel.org
Subject: Re: overlaping printk
Date: Thu, 20 May 2004 16:11:43 -0700	[thread overview]
Message-ID: <20040520161143.5677e9b7.akpm@osdl.org> (raw)
In-Reply-To: <20040520185745.GA7706@elte.hu>

Ingo Molnar <mingo@elte.hu> wrote:
>
> i've attached a new patch that does what Andi suggested too - 
> timestamping of the oopses. This way we will zap no sooner than 10 
> seconds after the first oops.

I think that will do the wrong thing between 23 and 47 days uptime because
time_after() will return an incorrect answer.

How's this look?




- Bump the timeout to 30 seconds - 9600 baud is slow.

- Handle jiffy wraps: change the logic so that we only skip the lockbust if
  the current time is within 30 seconds of the previous lockbusting attempt.



---

 25-akpm/kernel/printk.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff -puN kernel/printk.c~mangled-printk-oops-output-fix-tweaks kernel/printk.c
--- 25/kernel/printk.c~mangled-printk-oops-output-fix-tweaks	Thu May 20 16:01:53 2004
+++ 25-akpm/kernel/printk.c	Thu May 20 16:10:32 2004
@@ -55,9 +55,6 @@ EXPORT_SYMBOL(console_printk);
 
 int oops_in_progress;
 
-/* zap spinlocks only once: */
-unsigned long oops_timestamp;
-
 /*
  * console_sem protects the console_drivers list, and also
  * provides serialisation for access to the entire console
@@ -479,10 +476,14 @@ static void emit_log_char(char c)
  * every 10 seconds, to leave time for slow consoles to print a
  * full oops.
  */
-static inline void zap_locks(void)
+static void zap_locks(void)
 {
-	if (!time_after(jiffies, oops_timestamp + 10*HZ))
+	static unsigned long oops_timestamp;
+
+	if (time_after_eq(jiffies, oops_timestamp) &&
+			!time_after(jiffies, oops_timestamp + 30*HZ))
 		return;
+
 	oops_timestamp = jiffies;
 
 	/* If a crash is occurring, make sure we can't deadlock */

_


  reply	other threads:[~2004-05-20 23:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1XBEP-Mc-49@gated-at.bofh.it>
     [not found] ` <1XBXw-13D-3@gated-at.bofh.it>
     [not found]   ` <1XWpp-zy-9@gated-at.bofh.it>
2004-05-20 14:53     ` overlaping printk Andi Kleen
2004-05-20 15:19       ` Ingo Molnar
2004-05-20 15:53         ` Ingo Molnar
2004-05-20 16:19           ` Andy Isaacson
2004-05-20 18:57             ` Ingo Molnar
2004-05-20 23:11               ` Andrew Morton [this message]
2004-05-21  7:00                 ` Ingo Molnar
2004-05-19 15:55 Tuukka Toivonen
2004-05-19 16:03 ` Ricky Beam
2004-05-20 14:03   ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2004-05-19 15:19 Ricky Beam
2004-05-19 15:26 ` Tigran Aivazian
2004-05-19 15:31   ` Ricky Beam
2004-05-19 15:39 ` Randy.Dunlap
2004-05-20  7:21 ` Andrew Morton

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=20040520161143.5677e9b7.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=adi@hexapodia.org \
    --cc=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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