All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: "Tim Hockin" <thockin@google.com>
Cc: ak@muc.de, vojtech@suse.cz, linux-kernel@vger.kernel.org,
	akpm@google.com
Subject: Re: [PATCH] x86_64: dynamic MCE poll interval
Date: Fri, 27 Apr 2007 14:19:08 -0700	[thread overview]
Message-ID: <20070427141908.114bfe5a.randy.dunlap@oracle.com> (raw)
In-Reply-To: <cc96a5040704271351jd25cfe0md72b64d49906d796@mail.gmail.com>

On Fri, 27 Apr 2007 13:51:28 -0700 Tim Hockin wrote:

> This is the third version of this patch.  The only change from the prior
> version is to use time_after_eq().
> 
> diff -pruN linux-2.6.20/arch/x86_64/kernel/mce.c
> linux-2.6.20+th/arch/x86_64/kernel/mce.c
> --- linux-2.6.20/arch/x86_64/kernel/mce.c	2007-04-27 10:01:02.000000000 -0700
> +++ linux-2.6.20+th/arch/x86_64/kernel/mce.c	2007-04-27 10:41:02.000000000 -0700
> @@ -349,17 +351,30 @@ static void mcheck_timer(struct work_str
>  	 * writes.
>  	 */
>  	if (notify_user && console_logged) {
> +		static unsigned long last_print = 0;

Don't need to init statics to 0...

> +		unsigned long now = jiffies;
> +
> +		/* if we logged an MCE, reduce the polling interval */
> +		next_interval = max(next_interval/2, HZ/100);
>  		notify_user = 0;
>  		clear_bit(0, &console_logged);
> -		printk(KERN_INFO "Machine check events logged\n");
> +		if (time_after_eq(now, last_print + (check_interval*HZ))) {
> +			last_print = now;
> +			printk(KERN_INFO "Machine check events logged\n");
> +		}
> +	} else {
> +		next_interval = min(next_interval*2, check_interval*HZ);
>  	}
> +
> +	schedule_delayed_work(&mcheck_work, next_interval);
>  }


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

      parent reply	other threads:[~2007-04-27 21:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-27  1:02 [PATCH] x86_64: dynamic MCE poll interval Tim Hockin
2007-04-27  9:09 ` Andi Kleen
2007-04-27 16:58   ` Tim Hockin
2007-04-27 17:02     ` Andi Kleen
2007-04-27 17:05       ` Tim Hockin
2007-04-27 17:08         ` Andi Kleen
2007-04-27 18:28 ` Tim Hockin
2007-04-27 19:28   ` Andi Kleen
2007-04-27 20:51   ` Tim Hockin
2007-04-27 21:03     ` Tim Hockin
2007-04-27 21:19     ` Randy Dunlap [this message]

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=20070427141908.114bfe5a.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=ak@muc.de \
    --cc=akpm@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thockin@google.com \
    --cc=vojtech@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.