while (atomic_read(&stop_count) != cpus-1)
cpu_relax();
/* *Ifthetestwassuccessfulsetthenumberofrunstozeroand *stop.Ifnot,decrementthenumberofrunsancheckifwecan *retry.Incaseofrandomwarpsnoretryisattempted.
*/ if (!nr_warps) {
atomic_set(&test_runs, 0);
pr_info("Counter synchronization [CPU#%d -> CPU#%u]: passed\n",
smp_processor_id(), cpu);
} elseif (atomic_dec_and_test(&test_runs) || random_warps) { /* Force it to 0 if random warps brought us here */
atomic_set(&test_runs, 0);
pr_info("Counter synchronization [CPU#%d -> CPU#%u]:\n",
smp_processor_id(), cpu);
pr_info("Measured %d cycles counter warp between CPUs", max_warp); if (random_warps)
pr_warn("Counter warped randomly between CPUs\n");
}
if (!cpu_has_counter || !mips_hpt_frequency) return;
/* Kick the control CPU into the counter synchronization function */
smp_call_function_single(cpumask_first(cpu_online_mask),
check_counter_sync_source,
(unsignedlong *)(unsignedlong)cpu, 0);
retry: /* *RegisterthisCPU'sparticipationandwaitforthe *sourceCPUtostartthemeasurement:
*/
atomic_inc(&start_count); while (atomic_read(&start_count) != cpus)
cpu_relax();
/* *Checkthenumberofremainingtestruns.Ifnotzero,thetest *failedandaretrywithadjustedcounterispossible.Ifzerothe *testwaseithersuccessfulorfailedterminally.
*/ if (!atomic_read(&test_runs)) { /* Arrange for an interrupt in a short while */
write_c0_compare(read_c0_count() + COUNTON); return;
}
/* *IfthewarpvalueofthisCPUis0,thentheotherCPU *observedtimegoingbackwardssothiscounterwasaheadand *needstomovebackwards.
*/ if (!cur_max_warp)
cur_max_warp = -gbl_max_warp;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.