From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3D62C102.3070400@dslextreme.com> Date: Tue, 20 Aug 2002 15:21:54 -0700 From: akuster Reply-To: akuster@dslextreme.com MIME-Version: 1.0 To: Milton Miller Cc: Tom Rini , paulus@samba.org, Troy Benjegerdes , linuxppc-dev@lists.linuxppc.org Subject: Re: [PATCH] fix percpu heartbeats References: <200208190419.g7J4J1e25498@sullivan.realtime.net> Content-Type: multipart/mixed; boundary="------------010707020801080706030401" Sender: owner-linuxppc-dev@lists.linuxppc.org List-Id: This is a multi-part message in MIME format. --------------010707020801080706030401 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 > + * 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 --------------010707020801080706030401 Content-Type: application/x-gunzip; name="wdt_0820.patch.gz" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="wdt_0820.patch.gz" H4sICIbAYj0CA3dkdF8wODIwLnBhdGNoAK1XeW/aSBT/2/4Ur4la4YCDzZWQbLqhx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6g2KYu8fvolYbAzD+s1JuJy3CQ8 qRxrePpLzvc5UcZDOb4N1leBTl84799GGOJSdnoS2n8Zj/5fNMqfYS9hbPEngGmdro10+GUO OgaR4VNraGzB139jsuufthEAAA== --------------010707020801080706030401-- ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/