urcu-defer: remove call_rcu() API, replace by defer_rcu()
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Fri, 23 Oct 2009 11:57:28 +0000 (07:57 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Fri, 23 Oct 2009 11:57:28 +0000 (07:57 -0400)
Ensure we do not expose an API different from the kernel with the same name and
different semantic.

defer_rcu() cannot be called from within a RCU read-side C.S..

call_rcu() should eventually be re-implemented with struct rcu_head, permitting
to be called from within a RCU read-side C.S.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
tests/test_urcu_defer.c
urcu-defer.c
urcu-defer.h

index 309c3b2767d327f3691cae01fc6f3de2e2927921..72c598b40a0552f4b60b03ac38c511b417796c9b 100644 (file)
@@ -236,14 +236,14 @@ void *thr_writer(void *data)
                new = malloc(sizeof(*new));
                new->a = 8;
                old = rcu_xchg_pointer(&test_rcu_pointer, new);
-               call_rcu(free, old);
-               call_rcu(test_cb1, old);
-               call_rcu(test_cb1, (void *)-2L);
-               call_rcu(test_cb1, (void *)-2L);
-               call_rcu(test_cb1, old);
-               call_rcu(test_cb2, (void *)-2L);
-               call_rcu(test_cb2, (void *)-4L);
-               call_rcu(test_cb2, (void *)-2L);
+               defer_rcu(free, old);
+               defer_rcu(test_cb1, old);
+               defer_rcu(test_cb1, (void *)-2L);
+               defer_rcu(test_cb1, (void *)-2L);
+               defer_rcu(test_cb1, old);
+               defer_rcu(test_cb2, (void *)-2L);
+               defer_rcu(test_cb2, (void *)-4L);
+               defer_rcu(test_cb2, (void *)-2L);
                nr_writes++;
                if (unlikely(!test_duration_write()))
                        break;
index ed627a356a0b58e938e89eaea83f7f58333aee52..dd570713ee8234a82fa80208f612565c5028c112 100644 (file)
@@ -230,9 +230,9 @@ end:
 }
 
 /*
- * _rcu_defer_queue - Queue a RCU callback.
+ * _defer_rcu - Queue a RCU callback.
  */
-void _rcu_defer_queue(void (*fct)(void *p), void *p)
+void _defer_rcu(void (*fct)(void *p), void *p)
 {
        unsigned long head, tail;
 
@@ -315,9 +315,9 @@ void *thr_defer(void *args)
  * library wrappers to be used by non-LGPL compatible source code.
  */
 
-void rcu_defer_queue(void (*fct)(void *p), void *p)
+void defer_rcu(void (*fct)(void *p), void *p)
 {
-       _rcu_defer_queue(fct, p);
+       _defer_rcu(fct, p);
 }
 
 static void start_defer_thread(void)
index e32156c010fdeae325c54b28ee17bb1e72d8d3ec..9fdaf1863b038e44ac6637e133dfbd4c5284f957 100644 (file)
  * rcu_defer_register_thread(). rcu_defer_unregister_thread() should be
  * called before the thread exits.
  *
- * *NEVER* use call_rcu()/rcu_defer_queue() within a RCU read-side critical
- * section, because this primitive need to call synchronize_rcu() if the thread
- * queue is full.
+ * *NEVER* use defer_rcu() within a RCU read-side critical section, because this
+ * primitive need to call synchronize_rcu() if the thread queue is full.
  */
 
-#define call_rcu               rcu_defer_queue
-#define rcu_reclaim_queue(p)   rcu_defer_queue(free, p)
+#define rcu_reclaim_queue(p)   defer_rcu(free, p)
 
-extern void rcu_defer_queue(void (*fct)(void *p), void *p);
+extern void defer_rcu(void (*fct)(void *p), void *p);
 
 /*
  * Thread registration for reclamation.
This page took 0.027226 seconds and 4 git commands to generate.