Since we'd like the updates to be done as synchronously as possible,
make an attempt at yielding immediately after the TSC write.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
atomic_inc(&r->semaphore);
if ( i == 0 )
+ {
write_tsc(master_tsc);
+ /*
+ * Try to give our hyperthread(s), if any, a chance to do
+ * the same as instantly as possible.
+ */
+ cpu_relax();
+ }
while ( atomic_read(&r->semaphore) != (2*total_cpus - 1) )
cpu_relax();
}
if ( i == 0 )
+ {
write_tsc(master_tsc);
+ /*
+ * Try to give our hyperthread(s), if any, a chance to do
+ * the same as instantly as possible.
+ */
+ cpu_relax();
+ }
atomic_inc(&r->semaphore);
while ( atomic_read(&r->semaphore) > total_cpus )