public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jack Steiner <steiner@sgi.com>,
	linux-kernel@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/6] x86_64 UV: Use LED to indicate CPU is active
Date: Mon, 25 Aug 2008 10:49:21 -0700	[thread overview]
Message-ID: <48B2F0A1.4070205@sgi.com> (raw)
In-Reply-To: <20080811155318.GB4524@elte.hu>

Ingo Molnar wrote:
> * Mike Travis <travis@sgi.com> wrote:
> 
>> +/*
>> + * Illuminate "activity" LED when CPU is going "active",
>> + * extinguish when going "idle".
>> + */
>> +static int uv_idle(struct notifier_block *nfb, unsigned long action, void *junk)
>> +{
>> +	if (action == IDLE_START)
>> +		uv_set_led_bits(0, LED_CPU_ACTIVITY);
>> +
>> +	else if (action == IDLE_END)
>> +		uv_set_led_bits(LED_CPU_ACTIVITY, LED_CPU_ACTIVITY);
>> +
>> +	return NOTIFY_OK;
>> +}
>> +
>> +static struct notifier_block uv_idle_notifier = {
>> +	.notifier_call = uv_idle,
>> +};
>>  
>> +/*
>> + * Initialize idle led callback function
>> + */
>> +static __init void uv_init_led_idle_display(void)
>> +{
>> +	/* initialize timer for activity monitor */
>> +	idle_notifier_register(&uv_idle_notifier);
>> +}
> 
> hm, i think this is a bad idea. While putting it into the go-to-idle 
> codepath probably doesnt matter, putting anything into the idle wakeup 
> path increases latency of a rather critical codepath. The MMR write that 
> the LED driver is using will go out to the local bus, which, even if 
> it's POST-ed, if it's done frequently enough will be the cost of an IO 
> cycle.
> 
> No human needs to know the LED status at _that_ frequency anyway, so 
> it's quite pointless as well.
> 
> A much better (and faster) approach would be to sample the utilization 
> of the CPU and indicate that via the LED(s).
> 
> 	Ingo

Hi Ingo,

I'll take a closer look at this.  The actual usage is more in line with
an SNMP type system controller that has direct access to the BIOS registers
including the "LED" register and is used mostly for diagnosing system
problems.  The other research I need to do is how fast/slow is this path.
It may be a simple memory write in our UV NUMA hub chip that's not directed
to the general I/O bus and hence, negligible overhead.

Looking at the IA64 code, it has a similar interface which uses a function
pointer variable to set/reset "idle" state.  I just wish x86_64 had a similar
common interface for the clock handler that would occur per cpu and not per
group of cpus that clocksource_watchdog() currently uses.

The other architectural change I would like to make is to expose the necessary
data/address via the pda (or something similar) and allow the complete write
to be inlined to one or two instructions.

Thanks,
Mike

  parent reply	other threads:[~2008-08-25 17:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08  0:56 [PATCH 0/6] SGI UV: Provide a LED driver and some System Activity Indicators Mike Travis
2008-08-08  0:56 ` [PATCH 1/6] x86_64 UV: Provide a LED driver for UV Systems Mike Travis
2008-08-08  0:56 ` [PATCH 2/6] x86_64 UV: Use LED to indicate CPU is active Mike Travis
2008-08-11 15:53   ` Ingo Molnar
2008-08-13  9:56     ` Pavel Machek
2008-08-25 17:53       ` Mike Travis
2008-08-25 17:49     ` Mike Travis [this message]
2008-08-08  0:56 ` [PATCH 3/6] x86_64 UV: Use blinking LED for heartbeat display Mike Travis
2008-08-11 16:02   ` Ingo Molnar
2008-08-13  9:57     ` Pavel Machek
2008-08-26 20:53       ` Mike Travis
2008-08-27 21:38         ` Pavel Machek
2008-08-25 17:55     ` Mike Travis
2008-08-08  0:56 ` [PATCH 4/6] ia64 UV: Provide a LED driver for UV Systems Mike Travis
2008-08-08  6:07   ` Andrew Morton
2008-08-08  0:56 ` [PATCH 5/6] ia64 UV: Use LED to indicate CPU is active Mike Travis
2008-08-08  0:56 ` [PATCH 6/6] ia64 UV: Use blinking LED for heartbeat display Mike Travis

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=48B2F0A1.4070205@sgi.com \
    --to=travis@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=steiner@sgi.com \
    --cc=tglx@linutronix.de \
    /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