* Heartbeat revisited
@ 2001-11-07 1:47 Val Henson
0 siblings, 0 replies; only message in thread
From: Val Henson @ 2001-11-07 1:47 UTC (permalink / raw)
To: Tom Rini, Paul Mackerras; +Cc: linuxppc-dev
Y'all will recall the debate a few months ago about the proper
behaviour of the ppc_md.heartbeat function. The conclusion was that
the heartbeat function should be run once on each cpu per hearbeat
interval.
Unfortunately, the solution made the interval between calls of the
heartbeat function dependent on the number of cpus in the system:
if (ppc_md.heartbeat && !ppc_md.heartbeat_count--)
ppc_md.heartbeat();
Since it decrements the heartbeat_count once per cpu per timer
interrupt. If this is declared to be the desired and intended
behavior, I'll change Gemini to work around it. Otherwise, I suggest
something like:
if (ppc_md.heartbeat) {
if (!smp_processor_id())
ppc_md.heartbeat_count--;
if (!ppc_md.heartbeat_count)
ppc_md.heartbeat();
}
Or the simpler and originally intended form that only executes on one CPU:
if (ppc_md.heartbeat && !smp_processor_id() &&
!ppc_md.heartbeat_count--)
ppc_md.heartbeat();
Also, you need to be careful to reset the heartbeat even if you aren't
executing the heartbeat function. The last heartbeat discussion left
Gemini with a negative heartbeat count after a few calls of the
heartbeat function.
-VAL
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-11-07 1:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-07 1:47 Heartbeat revisited Val Henson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).