Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754034AbcLMU1S (ORCPT ); Tue, 13 Dec 2016 15:27:18 -0500 Received: from p3plsmtps2ded02.prod.phx3.secureserver.net ([208.109.80.59]:58912 "EHLO p3plsmtps2ded02.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753741AbcLMU0P (ORCPT ); Tue, 13 Dec 2016 15:26:15 -0500 x-originating-ip: 72.167.245.219 From: Matthew Wilcox To: linux-kernel@vger.kernel.org, Andrew Morton Cc: Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Konstantin Khlebnikov , Ross Zwisler , "Kirill A . Shutemov" , Tejun Heo Subject: [PATCH 4/5] radix tree test suite: Delete unused rcupdate.c Date: Tue, 13 Dec 2016 14:21:31 -0800 Message-Id: <1481667692-14500-5-git-send-email-mawilcox@linuxonhyperv.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1481667692-14500-1-git-send-email-mawilcox@linuxonhyperv.com> References: <1481667692-14500-1-git-send-email-mawilcox@linuxonhyperv.com> X-CMAE-Envelope: MS4wfGQz8L/8G8kq7T25RqTbOjh9mznWcbiMQfmXf78/tsGD+TzCVkmxdG0cG1MMvvzkmLg9oV7i9FzYAJUQp+c2ApTtKOPhSO2tgVXbqJkuamjHYUeDiDpj hFjpVNHFxcCm6LXYc6kDtqpR3xRbjzbsPNZuwotluA81TeNvNnf5+/sPKFWGaxqK0TjccIkm2gujhz+YwH6Z9PGbflOmPQ3sH2Oq+UhDpSK4HmR1DRbkXT4V BFRHNDBME3+O4onVmUXnx9Kw7lu/O7MZMS03Xba5q+TR/T7/RkyftUcejYD0jWY+pnivjhIyymVdO+xR1TujzWlJn2CGuBAzCMMWjY5w7u+tY2NT874RO5Ut nNwBAwVH6jwkyy/f/wN5x9cmouE1Xgu/ba0RFIq22UCazc0oOnFdH3a2DShmbGgFpS/mQ69GK0zBzcnLUwQoHxyx1bJYHKY8qq7F0yjIZdqa2pN/zGu14FhD +hkJVVDfyfpiJGLR Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2437 Lines: 106 From: Matthew Wilcox 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. Signed-off-by: Matthew Wilcox --- tools/testing/radix-tree/rcupdate.c | 86 ------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 tools/testing/radix-tree/rcupdate.c diff --git a/tools/testing/radix-tree/rcupdate.c b/tools/testing/radix-tree/rcupdate.c deleted file mode 100644 index 31a2d14..0000000 --- a/tools/testing/radix-tree/rcupdate.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include - -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(); -} -- 2.10.2