the "reader kick" signal is only needed to perform a smp_mc() on readers, which
is pointless in a cache-coherent arch.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#ifdef HAS_INCOHERENT_CACHES
static void force_mb_single_thread(struct reader_registry *index)
{
smp_mb();
}
static void force_mb_single_thread(struct reader_registry *index)
{
smp_mb();
}
+#endif /* #ifdef HAS_INCOHERENT_CACHES */
static void force_mb_all_threads(void)
{
smp_mb();
}
static void force_mb_all_threads(void)
{
smp_mb();
}
+#else /* #ifdef DEBUG_FULL_MB */
+#ifdef HAS_INCOHERENT_CACHES
static void force_mb_single_thread(struct reader_registry *index)
{
assert(registry);
static void force_mb_single_thread(struct reader_registry *index)
{
assert(registry);
}
smp_mb(); /* read ->need_mb before ending the barrier */
}
}
smp_mb(); /* read ->need_mb before ending the barrier */
}
+#endif /* #ifdef HAS_INCOHERENT_CACHES */
static void force_mb_all_threads(void)
{
static void force_mb_all_threads(void)
{
}
smp_mb(); /* read ->need_mb before ending the barrier */
}
}
smp_mb(); /* read ->need_mb before ending the barrier */
}
+#endif /* #else #ifdef DEBUG_FULL_MB */
void wait_for_quiescent_state(void)
{
void wait_for_quiescent_state(void)
{
* Wait for each thread urcu_active_readers count to become 0.
*/
for (index = registry; index < registry + num_readers; index++) {
* Wait for each thread urcu_active_readers count to become 0.
*/
for (index = registry; index < registry + num_readers; index++) {
+#ifndef HAS_INCOHERENT_CACHES
+ while (rcu_old_gp_ongoing(index->urcu_active_readers))
+ cpu_relax();
+#else /* #ifndef HAS_INCOHERENT_CACHES */
int wait_loops = 0;
/*
* BUSY-LOOP. Force the reader thread to commit its
int wait_loops = 0;
/*
* BUSY-LOOP. Force the reader thread to commit its
+#endif /* #else #ifndef HAS_INCOHERENT_CACHES */
assert(act.sa_sigaction == sigurcu_handler);
free(registry);
}
assert(act.sa_sigaction == sigurcu_handler);
free(registry);
}
+#endif /* #ifndef DEBUG_FULL_MB */