Commit 2bc5c282 authored by Russ Anderson's avatar Russ Anderson Committed by Tony Luck

[IA64] Remove needless delay in MCA rendezvous

While testing the MCA recovery code, noticed that some machines would have a
five second delay rendezvousing cpus.  What was happening is that
ia64_wait_for_slaves() would check to see if all the slave CPUs had
rendezvoused.  If any had not, it would wait 1 millisecond then check again.
If any CPUs had still not rendezvoused, it would wait 5 seconds before
checking again.

On some configs the rendezvous takes more than 1 millisecond, causing the code
to wait the full 5 seconds, even though the last CPU rendezvoused after only
a few milliseconds.

The fix is to check every 1 millisecond to see if all the cpus have
rendezvoused.  After 5 seconds the code concludes the CPUs will never
rendezvous (same as before).

The MCA code is, by definition, not performance critical, but a needless
delay of 5 seconds is senseless.  The 5 seconds also adds up quickly
when running the error injection code in a loop.

This patch both simplifies the code and removes the needless delay.
Signed-off-by: default avatarRuss Anderson <rja@sgi.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 28eda5b8
...@@ -1135,30 +1135,27 @@ ia64_mca_modify_original_stack(struct pt_regs *regs, ...@@ -1135,30 +1135,27 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
static void static void
ia64_wait_for_slaves(int monarch, const char *type) ia64_wait_for_slaves(int monarch, const char *type)
{ {
int c, wait = 0, missing = 0; int c, i , wait;
for_each_online_cpu(c) {
if (c == monarch) /*
continue; * wait 5 seconds total for slaves (arbitrary)
if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) { */
udelay(1000); /* short wait first */ for (i = 0; i < 5000; i++) {
wait = 1; wait = 0;
break; for_each_online_cpu(c) {
} if (c == monarch)
} continue;
if (!wait) if (ia64_mc_info.imi_rendez_checkin[c]
goto all_in; == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) {
for_each_online_cpu(c) { udelay(1000); /* short wait */
if (c == monarch) wait = 1;
continue; break;
if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) { }
udelay(5*1000000); /* wait 5 seconds for slaves (arbitrary) */
if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE)
missing = 1;
break;
} }
if (!wait)
goto all_in;
} }
if (!missing)
goto all_in;
/* /*
* Maybe slave(s) dead. Print buffered messages immediately. * Maybe slave(s) dead. Print buffered messages immediately.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment