radix tree test suite: delete unused rcupdate.c
authorMatthew Wilcox <mawilcox@microsoft.com>
Wed, 14 Dec 2016 23:09:36 +0000 (15:09 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 15 Dec 2016 00:04:10 +0000 (16:04 -0800)
This file was used to implement call_rcu() before liburcu implemented
that function.  It hasn't even been compiled since before the test suite
was added to the kernel.  Remove it to reduce confusion.

Link: http://lkml.kernel.org/r/1481667692-14500-5-git-send-email-mawilcox@linuxonhyperv.com
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/radix-tree/rcupdate.c [deleted file]

diff --git a/tools/testing/radix-tree/rcupdate.c b/tools/testing/radix-tree/rcupdate.c
deleted file mode 100644 (file)
index 31a2d14..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#include <linux/rcupdate.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <assert.h>
-
-static pthread_mutex_t rculock = PTHREAD_MUTEX_INITIALIZER;
-static struct rcu_head *rcuhead_global = NULL;
-static __thread int nr_rcuhead = 0;
-static __thread struct rcu_head *rcuhead = NULL;
-static __thread struct rcu_head *rcutail = NULL;
-
-static pthread_cond_t rcu_worker_cond = PTHREAD_COND_INITIALIZER;
-
-/* switch to urcu implementation when it is merged. */
-void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *head))
-{
-       head->func = func;
-       head->next = rcuhead;
-       rcuhead = head;
-       if (!rcutail)
-               rcutail = head;
-       nr_rcuhead++;
-       if (nr_rcuhead >= 1000) {
-               int signal = 0;
-
-               pthread_mutex_lock(&rculock);
-               if (!rcuhead_global)
-                       signal = 1;
-               rcutail->next = rcuhead_global;
-               rcuhead_global = head;
-               pthread_mutex_unlock(&rculock);
-
-               nr_rcuhead = 0;
-               rcuhead = NULL;
-               rcutail = NULL;
-
-               if (signal) {
-                       pthread_cond_signal(&rcu_worker_cond);
-               }
-       }
-}
-
-static void *rcu_worker(void *arg)
-{
-       struct rcu_head *r;
-
-       rcupdate_thread_init();
-
-       while (1) {
-               pthread_mutex_lock(&rculock);
-               while (!rcuhead_global) {
-                       pthread_cond_wait(&rcu_worker_cond, &rculock);
-               }
-               r = rcuhead_global;
-               rcuhead_global = NULL;
-
-               pthread_mutex_unlock(&rculock);
-
-               synchronize_rcu();
-
-               while (r) {
-                       struct rcu_head *tmp = r->next;
-                       r->func(r);
-                       r = tmp;
-               }
-       }
-
-       rcupdate_thread_exit();
-
-       return NULL;
-}
-
-static pthread_t worker_thread;
-void rcupdate_init(void)
-{
-       pthread_create(&worker_thread, NULL, rcu_worker, NULL);
-}
-
-void rcupdate_thread_init(void)
-{
-       rcu_register_thread();
-}
-void rcupdate_thread_exit(void)
-{
-       rcu_unregister_thread();
-}