PERFORCE change 63010 for review
John Baldwin
jhb at FreeBSD.org
Mon Oct 11 13:49:01 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=63010
Change 63010 by jhb at jhb_twclab on 2004/10/11 20:48:34
- Remove superflous nothing comments.
- Use cpu_spinwait() in the rendezvous spins.
- Correct the counter indices for the second and third spins.
Affected files ...
.. //depot/projects/smpng/sys/kern/subr_smp.c#38 edit
Differences ...
==== //depot/projects/smpng/sys/kern/subr_smp.c#38 (text+ko) ====
@@ -284,7 +284,6 @@
/* wait for each to clear its bit */
while ((stopped_cpus & map) != 0)
- /* nothing */
cpu_spinwait();
return 1;
@@ -306,21 +305,26 @@
/* Ensure we have up-to-date values. */
atomic_add_acq_int(&smp_rv_waiters[0], 1);
while (smp_rv_waiters[0] < mp_ncpus)
- ; /* nothing */
+ cpu_spinwait();
+
/* setup function */
if (smp_rv_setup_func != NULL)
smp_rv_setup_func(smp_rv_func_arg);
+
/* spin on entry rendezvous */
atomic_add_int(&smp_rv_waiters[1], 1);
- while (smp_rv_waiters[0] < mp_ncpus)
- ; /* nothing */
+ while (smp_rv_waiters[1] < mp_ncpus)
+ cpu_spinwait();
+
/* action function */
if (smp_rv_action_func != NULL)
smp_rv_action_func(smp_rv_func_arg);
+
/* spin on exit rendezvous */
atomic_add_int(&smp_rv_waiters[2], 1);
- while (smp_rv_waiters[1] < mp_ncpus)
- ; /* nothing */
+ while (smp_rv_waiters[2] < mp_ncpus)
+ cpu_spinwait();
+
/* teardown function */
if (smp_rv_teardown_func != NULL)
smp_rv_teardown_func(smp_rv_func_arg);
More information about the p4-projects
mailing list