public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: TAMUKI Shoichi <tamuki@linet.gr.jp>
Cc: Ingo Molnar <mingo@elte.hu>, Anton Blanchard <anton@samba.org>,
	Andi Kleen <andi@firstfloor.org>, Andy Green <andy@warmcat.com>,
	Randy Dunlap <randy.dunlap@oracle.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] panic: keep blinking in spite of long spin timer mode
Date: Thu, 3 Jun 2010 15:30:16 -0700	[thread overview]
Message-ID: <20100603153016.cbe6ff0c.akpm@linux-foundation.org> (raw)
In-Reply-To: <201006032201.AA00424@tamuki.linet.gr.jp>

On Fri, 04 Jun 2010 07:01:16 +0900
TAMUKI Shoichi <tamuki@linet.gr.jp> wrote:

> To keep panic_timeout accuracy when running under a hypervisor, the
> current implementation only spins on long time (1 second) calls to
> mdelay.  That brings a good effect, but the problem is the keyboard
> LEDs don't blink at all on that situation.
> 
> This patch changes to call to panic_blink_enter() between every mdelay
> and keeps blinking in spite of long spin timer mode.
> 
> The default time to call to mdelay is 1ms.  If the speed of blinking
> is slow enough, the time to call to mdelay will be automatically
> switched to longer.  This is suitable when running under a hypervisor.
> 
> ...
> 
>  Documentation/kernel-parameters.txt |    8 +-
>  arch/arm/mach-s3c2440/mach-gta02.c  |   17 +----
>  drivers/input/serio/i8042.c         |   25 +-------
>  include/linux/kernel.h              |    2 
>  kernel/panic.c                      |   77 +++++++++++++++++---------
>  5 files changed, 67 insertions(+), 62 deletions(-)

It cleans up the led-blinking implementations nicely.  That's good.

> 
> ...
>
> +	panicblink=	[KNL] The speed of panic blink (default is 12 wpm)
> +			The period of panic blink can be computed by the
> +			formula T = 7200 / W, where T is the period in milli-
> +			seconds, W is the speed in wpm (words per minute).
> +			Should be 5 or less when running under a hypervisor

Nobody will know what "wpm" means.  What is a "word" in this context? 
Unclear.

How about "bpm": "blinks per minute".  That's nice and direct.

>
> ...
>
>  
> +	if (panic_blink_wpm <= 0 || panic_blink_wpm > 100)
> +		panic_blink_wpm = 12;

hm, OK.  Or we could do

	if (panic_blink_wpm <= 0)
		panic_blink_wpm = 1;
	if (panic_blink_wpm > 100)
		panic_blink_wpm = 100;

which is handily encapsulated in the clamp() macro which nobody uses.

> +	if (!panic_blink)
> +		panic_blink = no_blink;

Can we initialise panic_blink to no_blink at compile-time then remove this?

>
> ...
>


  reply	other threads:[~2010-06-03 22:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-03 22:01 [PATCH v2] panic: keep blinking in spite of long spin timer mode TAMUKI Shoichi
2010-06-03 22:30 ` Andrew Morton [this message]
2010-06-06 13:19   ` TAMUKI Shoichi
2010-06-09 22:15     ` Andrew Morton
2010-06-10  2:30       ` Anton Blanchard
2010-06-10 22:31         ` TAMUKI Shoichi
2010-06-10 22:31       ` TAMUKI Shoichi
2010-06-14 21:14         ` Andrew Morton
2010-06-15 22:25           ` TAMUKI Shoichi
2010-06-06 13:33   ` [PATCH v2.1] " TAMUKI Shoichi

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=20100603153016.cbe6ff0c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=andy@warmcat.com \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=randy.dunlap@oracle.com \
    --cc=tamuki@linet.gr.jp \
    /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