All of lore.kernel.org
 help / color / mirror / Atom feed
From: akuster <akuster@dslextreme.com>
To: Milton Miller <miltonm@bga.com>
Cc: Tom Rini <trini@kernel.crashing.org>,
	paulus@samba.org, Troy Benjegerdes <hozer@drgw.net>,
	linuxppc-dev@lists.linuxppc.org
Subject: Re: [PATCH] fix percpu heartbeats
Date: Tue, 20 Aug 2002 15:21:54 -0700	[thread overview]
Message-ID: <3D62C102.3070400@dslextreme.com> (raw)
In-Reply-To: 200208190419.g7J4J1e25498@sullivan.realtime.net

[-- Attachment #1: Type: text/plain, Size: 3631 bytes --]

Milton Miller wrote:
> The changeset of Cort's patch that Troy checked in is broken in several ways:
>
> 1) The slave cpus no longer call heartbeats at all because there was a
> previous continue in the loop. (reordered and used remembered cpu number)
>
> 2) The rtas call rate is per-minute not per-second.  (correct the rate)
>
> 3) All the rtas calls will occur at the same time, modulo the contended
> rtas lock.  (wait to divide the rate until smp_kick_cpus).
>
> 4) It added NRCPUS*3 words to ppc_md.  It also pointed out we were modifing
> this structre repeatedly at runtime.  [moved the counts to the cache hot
> and dirty per-cpu irqstat and allow only one choice of function, just per
> cpu countdown and period.  The count is always decremented, but only when
> it reaches zero do we decide to call the function by checking the reset
> value for non-zero.  The period is reset after the call, so aperiodic
> users (like 4xx watchdog maybe?) could clear the count during their callback.]
>
> I know there are other alternatives, but the cost to non-users is minimal
> (an extra branch and compare every 2*32 jiffies), and the the periodic
> call usage is set it up and forget it.
>
>
> I'll read comments through the lists, so no need to cc me.
>
> milton
>
> ===== arch/ppc/kernel/ppc4xx_setup.c 1.46 vs 1.47 =====
> --- 1.46/arch/ppc/kernel/ppc4xx_setup.c	Fri Aug  2 11:30:01 2002
> +++ 1.47/arch/ppc/kernel/ppc4xx_setup.c	Sun Aug 18 21:03:03 2002
> @@ -383,6 +383,8 @@
>  		strcpy(cmd_line, (char *) (r6 + KERNELBASE));
>  	}
>  #if defined(CONFIG_PPC405_WDT)
> +	ppc_md.heartbeat = ppc4xx_wdt_heartbeat;
> +
>  /* Look for wdt= option on command line */
>  	if (strstr(cmd_line, "wdt=")) {
>  		int valid_wdt = 0;
> @@ -396,6 +398,26 @@
>  			++q;
>  		}
>  		wdt_enable = valid_wdt;
> +
> +		/* XXX why is the wdt functoin modifing count and not
> +		 * using reset ??  If this code wants kernel heartbeat
> +		 * calls then:
> +		 *
> +		 * #include <asm/hwirq.h>
> +		 * heartbeat_reset(cpu) = period_in_jiffies;
> +		 * heartbeat_count(cpu) = period_in_jiffies;
> +		 *
> +		 * The function will be called from the timer interrupt
> +		 * when the counts reaches 0, afterwards the count will
> +		 * be set to the heartbeat_reset(cpu) value (which
> +		 * could be cleard during call for one-shot mode).
> +		 *
> +		 * If the code doesn't want the count manageed it
> +		 * should not use the kernel callbacks (or set reset
> +		 * to 1 and use its own counters).
> +		 */
> +#error sanitize wdt and kernel heartbeat interactions
> +
>  	}
>  #endif
>
> @@ -411,11 +433,6 @@
>  	ppc_md.halt = ppc4xx_halt;
>
>  	ppc_md.calibrate_decr = ppc4xx_calibrate_decr;
> -
> -#ifdef CONFIG_PPC405_WDT
> -	ppc_md.heartbeat = ppc4xx_wdt_heartbeat;
> -#endif
> -	ppc_md.heartbeat_count = 0;
>
>  	ppc_md.find_end_of_memory = ppc4xx_find_end_of_memory;
>  	ppc_md.setup_io_mappings = m4xx_map_io;

To all

Attcahed is a patch for 40x to get wdt working on top of Milton's
orginal patch

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#
            ChangeSet	1.1138  -> 1.1139
#
drivers/char/ppc405_wdt.c
1.3     -> 1.4
#
arch/ppc/kernel/ppc4xx_setup.c
1.46    -> 1.47
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/20	armin@essen.mvista.com	1.1139
# changes to make driver work w/ heartbeat_* changes
# changes to setup on top of mintons patch to make 40x to work


Armin



[-- Attachment #2: wdt_0820.patch.gz --]
[-- Type: application/x-gunzip, Size: 1747 bytes --]

      parent reply	other threads:[~2002-08-20 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-19  4:19 [PATCH] fix percpu heartbeats Milton Miller
2002-08-19  4:49 ` Troy Benjegerdes
2002-08-20 22:21 ` akuster [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=3D62C102.3070400@dslextreme.com \
    --to=akuster@dslextreme.com \
    --cc=hozer@drgw.net \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=miltonm@bga.com \
    --cc=paulus@samba.org \
    --cc=trini@kernel.crashing.org \
    /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.