4 * Userspace RCU library - test program
6 * Copyright February 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <sys/types.h>
40 #define DEFAULT_HASH_SIZE 32
41 #define DEFAULT_MIN_ALLOC_SIZE 1
42 #define DEFAULT_RAND_POOL 1000000
44 /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
45 #define CACHE_LINE_SIZE 4096
47 /* hardcoded number of CPUs */
51 #define poison_free(ptr) \
53 memset(ptr, 0x42, sizeof(*(ptr))); \
57 #define poison_free(ptr) free(ptr)
62 #if defined(_syscall0)
63 _syscall0(pid_t
, gettid
)
64 #elif defined(__NR_gettid)
65 static inline pid_t
gettid(void)
67 return syscall(__NR_gettid
);
70 #warning "use pid as tid"
71 static inline pid_t
gettid(void)
77 #ifndef DYNAMIC_LINK_TEST
80 #define debug_yield_read()
82 #include <urcu-qsbr.h>
83 #include <urcu/rculfhash.h>
84 #include <urcu-call-rcu.h>
87 unsigned long update_ops
;
89 unsigned long add_exist
;
93 static unsigned int __thread rand_lookup
;
94 static unsigned long __thread nr_add
;
95 static unsigned long __thread nr_addexist
;
96 static unsigned long __thread nr_del
;
97 static unsigned long __thread nr_delnoent
;
98 static unsigned long __thread lookup_fail
;
99 static unsigned long __thread lookup_ok
;
101 static struct cds_lfht
*test_ht
;
108 struct lfht_test_node
{
109 struct cds_lfht_node node
;
112 static inline struct lfht_test_node
*
113 to_test_node(struct cds_lfht_node
*node
)
115 return caa_container_of(node
, struct lfht_test_node
, node
);
119 void lfht_test_node_init(struct lfht_test_node
*node
, void *key
,
122 cds_lfht_node_init(&node
->node
, key
, key_len
);
125 static inline struct lfht_test_node
*
126 cds_lfht_iter_get_test_node(struct cds_lfht_iter
*iter
)
128 return to_test_node(cds_lfht_iter_get_node(iter
));
131 static volatile int test_go
, test_stop
;
133 static unsigned long wdelay
;
135 static unsigned long duration
;
137 /* read-side C.S. duration, in loops */
138 static unsigned long rduration
;
140 static unsigned long init_hash_size
= DEFAULT_HASH_SIZE
;
141 static unsigned long min_hash_alloc_size
= DEFAULT_MIN_ALLOC_SIZE
;
142 static unsigned long init_populate
;
143 static int opt_auto_resize
;
144 static int add_only
, add_unique
, add_replace
;
146 static unsigned long init_pool_offset
, lookup_pool_offset
, write_pool_offset
;
147 static unsigned long init_pool_size
= DEFAULT_RAND_POOL
,
148 lookup_pool_size
= DEFAULT_RAND_POOL
,
149 write_pool_size
= DEFAULT_RAND_POOL
;
150 static int validate_lookup
;
152 static int count_pipe
[2];
154 static inline void loop_sleep(unsigned long l
)
160 static int verbose_mode
;
162 #define printf_verbose(fmt, args...) \
165 printf(fmt, ## args); \
168 static unsigned int cpu_affinities
[NR_CPUS
];
169 static unsigned int next_aff
= 0;
170 static int use_affinity
= 0;
172 pthread_mutex_t affinity_mutex
= PTHREAD_MUTEX_INITIALIZER
;
174 static void set_affinity(void)
183 ret
= pthread_mutex_lock(&affinity_mutex
);
185 perror("Error in pthread mutex lock");
188 cpu
= cpu_affinities
[next_aff
++];
189 ret
= pthread_mutex_unlock(&affinity_mutex
);
191 perror("Error in pthread mutex unlock");
196 sched_setaffinity(0, sizeof(mask
), &mask
);
203 } addremove
; /* 1: add, -1 remove, 0: random */
206 void sigusr1_handler(int signo
)
210 printf("Add/Remove: random.\n");
211 addremove
= AR_RANDOM
;
214 printf("Add/Remove: remove only.\n");
215 addremove
= AR_REMOVE
;
218 printf("Add/Remove: add only.\n");
225 void sigusr2_handler(int signo
)
227 char msg
[1] = { 0x42 };
231 ret
= write(count_pipe
[1], msg
, 1); /* wakeup thread */
232 } while (ret
== -1L && errno
== EINTR
);
236 * returns 0 if test should end.
238 static int test_duration_write(void)
243 static int test_duration_read(void)
248 static unsigned long long __thread nr_writes
;
249 static unsigned long long __thread nr_reads
;
251 static unsigned int nr_readers
;
252 static unsigned int nr_writers
;
254 pthread_mutex_t rcu_copy_mutex
= PTHREAD_MUTEX_INITIALIZER
;
256 void rcu_copy_mutex_lock(void)
259 ret
= pthread_mutex_lock(&rcu_copy_mutex
);
261 perror("Error in pthread mutex lock");
266 void rcu_copy_mutex_unlock(void)
270 ret
= pthread_mutex_unlock(&rcu_copy_mutex
);
272 perror("Error in pthread mutex unlock");
279 * Source: http://burtleburtle.net/bob/c/lookup3.c
280 * Originally Public Domain
283 #define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
285 #define mix(a, b, c) \
287 a -= c; a ^= rot(c, 4); c += b; \
288 b -= a; b ^= rot(a, 6); a += c; \
289 c -= b; c ^= rot(b, 8); b += a; \
290 a -= c; a ^= rot(c, 16); c += b; \
291 b -= a; b ^= rot(a, 19); a += c; \
292 c -= b; c ^= rot(b, 4); b += a; \
295 #define final(a, b, c) \
297 c ^= b; c -= rot(b, 14); \
298 a ^= c; a -= rot(c, 11); \
299 b ^= a; b -= rot(a, 25); \
300 c ^= b; c -= rot(b, 16); \
301 a ^= c; a -= rot(c, 4);\
302 b ^= a; b -= rot(a, 14); \
303 c ^= b; c -= rot(b, 24); \
306 static __attribute__((unused
))
308 const uint32_t *k
, /* the key, an array of uint32_t values */
309 size_t length
, /* the length of the key, in uint32_ts */
310 uint32_t initval
) /* the previous hash, or an arbitrary value */
314 /* Set up the internal state */
315 a
= b
= c
= 0xdeadbeef + (((uint32_t) length
) << 2) + initval
;
317 /*----------------------------------------- handle most of the key */
327 /*----------------------------------- handle the last 3 uint32_t's */
328 switch (length
) { /* all the case statements fall through */
333 case 0: /* case 0: nothing left to add */
336 /*---------------------------------------------- report the result */
342 const uint32_t *k
, /* the key, an array of uint32_t values */
343 size_t length
, /* the length of the key, in uint32_ts */
344 uint32_t *pc
, /* IN: seed OUT: primary hash value */
345 uint32_t *pb
) /* IN: more seed OUT: secondary hash value */
349 /* Set up the internal state */
350 a
= b
= c
= 0xdeadbeef + ((uint32_t) (length
<< 2)) + *pc
;
353 /*----------------------------------------- handle most of the key */
363 /*----------------------------------- handle the last 3 uint32_t's */
364 switch (length
) { /* all the case statements fall through */
369 case 0: /* case 0: nothing left to add */
372 /*---------------------------------------------- report the result */
377 #if (CAA_BITS_PER_LONG == 32)
379 unsigned long test_hash(void *_key
, size_t length
, unsigned long seed
)
381 unsigned int key
= (unsigned int) _key
;
383 assert(length
== sizeof(unsigned int));
384 return hash_u32(&key
, 1, seed
);
388 unsigned long test_hash(void *_key
, size_t length
, unsigned long seed
)
399 assert(length
== sizeof(unsigned long));
400 v
.v64
= (uint64_t) seed
;
401 key
.v64
= (uint64_t) _key
;
402 hashword2(key
.v32
, 2, &v
.v32
[0], &v
.v32
[1]);
408 unsigned long test_compare(void *key1
, size_t key1_len
,
409 void *key2
, size_t key2_len
)
411 if (caa_unlikely(key1_len
!= key2_len
))
413 assert(key1_len
== sizeof(unsigned long));
420 void *thr_count(void *arg
)
422 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
423 "counter", pthread_self(), (unsigned long)gettid());
425 rcu_register_thread();
428 unsigned long count
, removed
;
429 long approx_before
, approx_after
;
433 rcu_thread_offline();
434 len
= read(count_pipe
[0], buf
, 1);
436 if (caa_unlikely(!test_duration_read()))
441 printf("Counting nodes... ");
444 cds_lfht_count_nodes(test_ht
, &approx_before
, &count
, &removed
,
448 printf("Approximation before node accounting: %ld nodes.\n",
450 printf("Accounting of nodes in the hash table: "
451 "%lu nodes + %lu logically removed.\n",
453 printf("Approximation after node accounting: %ld nodes.\n",
456 rcu_unregister_thread();
460 void *thr_reader(void *_count
)
462 unsigned long long *count
= _count
;
463 struct lfht_test_node
*node
;
464 struct cds_lfht_iter iter
;
466 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
467 "reader", pthread_self(), (unsigned long)gettid());
471 rcu_register_thread();
480 cds_lfht_lookup(test_ht
,
481 (void *)(((unsigned long) rand_r(&rand_lookup
) % lookup_pool_size
) + lookup_pool_offset
),
482 sizeof(void *), &iter
);
483 node
= cds_lfht_iter_get_test_node(&iter
);
485 if (validate_lookup
) {
486 printf("[ERROR] Lookup cannot find initial node.\n");
494 if (caa_unlikely(rduration
))
495 loop_sleep(rduration
);
498 if (caa_unlikely(!test_duration_read()))
500 if (caa_unlikely((nr_reads
& ((1 << 10) - 1)) == 0))
501 rcu_quiescent_state();
504 rcu_unregister_thread();
507 printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
508 "reader", pthread_self(), (unsigned long)gettid());
509 printf_verbose("readid : %lx, lookupfail %lu, lookupok %lu\n",
510 pthread_self(), lookup_fail
, lookup_ok
);
516 void free_node_cb(struct rcu_head
*head
)
518 struct lfht_test_node
*node
=
519 caa_container_of(head
, struct lfht_test_node
, node
.head
);
523 void *thr_writer(void *_count
)
525 struct lfht_test_node
*node
;
526 struct cds_lfht_node
*ret_node
;
527 struct cds_lfht_iter iter
;
528 struct wr_count
*count
= _count
;
531 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
532 "writer", pthread_self(), (unsigned long)gettid());
536 rcu_register_thread();
544 if ((addremove
== AR_ADD
|| add_only
)
545 || (addremove
== AR_RANDOM
&& rand_r(&rand_lookup
) & 1)) {
546 node
= malloc(sizeof(struct lfht_test_node
));
547 lfht_test_node_init(node
,
548 (void *)(((unsigned long) rand_r(&rand_lookup
) % write_pool_size
) + write_pool_offset
),
552 ret_node
= cds_lfht_add_unique(test_ht
, &node
->node
);
555 ret_node
= cds_lfht_add_replace(test_ht
, &node
->node
);
557 cds_lfht_add(test_ht
, &node
->node
);
560 if (add_unique
&& ret_node
!= &node
->node
) {
564 if (add_replace
&& ret_node
) {
565 call_rcu(&to_test_node(ret_node
)->node
.head
,
575 cds_lfht_lookup(test_ht
,
576 (void *)(((unsigned long) rand_r(&rand_lookup
) % write_pool_size
) + write_pool_offset
),
577 sizeof(void *), &iter
);
578 ret
= cds_lfht_del(test_ht
, &iter
);
581 node
= cds_lfht_iter_get_test_node(&iter
);
582 call_rcu(&node
->node
.head
, free_node_cb
);
588 //if (nr_writes % 100000 == 0) {
589 if (nr_writes
% 1000 == 0) {
591 if (rand_r(&rand_lookup
) & 1) {
592 ht_resize(test_ht
, 1);
594 ht_resize(test_ht
, -1);
600 if (caa_unlikely(!test_duration_write()))
602 if (caa_unlikely(wdelay
))
604 if (caa_unlikely((nr_writes
& ((1 << 10) - 1)) == 0))
605 rcu_quiescent_state();
608 rcu_unregister_thread();
610 printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
611 "writer", pthread_self(), (unsigned long)gettid());
612 printf_verbose("info id %lx: nr_add %lu, nr_addexist %lu, nr_del %lu, "
613 "nr_delnoent %lu\n", pthread_self(), nr_add
,
614 nr_addexist
, nr_del
, nr_delnoent
);
615 count
->update_ops
= nr_writes
;
617 count
->add_exist
= nr_addexist
;
618 count
->remove
= nr_del
;
622 static int populate_hash(void)
624 struct lfht_test_node
*node
;
625 struct cds_lfht_node
*ret_node
;
630 if ((add_unique
|| add_replace
) && init_populate
* 10 > init_pool_size
) {
631 printf("WARNING: required to populate %lu nodes (-k), but random "
632 "pool is quite small (%lu values) and we are in add_unique (-u) or add_replace (-s) mode. Try with a "
633 "larger random pool (-p option). This may take a while...\n", init_populate
, init_pool_size
);
636 while (nr_add
< init_populate
) {
637 node
= malloc(sizeof(struct lfht_test_node
));
638 lfht_test_node_init(node
,
639 (void *)(((unsigned long) rand_r(&rand_lookup
) % init_pool_size
) + init_pool_offset
),
643 ret_node
= cds_lfht_add_unique(test_ht
, &node
->node
);
646 ret_node
= cds_lfht_add_replace(test_ht
, &node
->node
);
648 cds_lfht_add(test_ht
, &node
->node
);
651 if (add_unique
&& ret_node
!= &node
->node
) {
655 if (add_replace
&& ret_node
) {
656 call_rcu(&to_test_node(ret_node
)->node
.head
, free_node_cb
);
668 void test_delete_all_nodes(struct cds_lfht
*ht
)
670 struct cds_lfht_iter iter
;
671 struct lfht_test_node
*node
;
672 unsigned long count
= 0;
674 cds_lfht_first(ht
, &iter
);
675 while ((node
= cds_lfht_iter_get_test_node(&iter
)) != NULL
) {
678 ret
= cds_lfht_del(test_ht
, &iter
);
680 call_rcu(&node
->node
.head
, free_node_cb
);
681 cds_lfht_next(ht
, &iter
);
684 printf("deleted %lu nodes.\n", count
);
687 void show_usage(int argc
, char **argv
)
689 printf("Usage : %s nr_readers nr_writers duration (s)\n", argv
[0]);
691 printf(" [-r] [-w] (yield reader and/or writer)\n");
693 printf(" [-d delay] (writer period (us))\n");
694 printf(" [-c duration] (reader C.S. duration (in loops))\n");
695 printf(" [-v] (verbose output)\n");
696 printf(" [-a cpu#] [-a cpu#]... (affinity)\n");
697 printf(" [-h size] (initial hash table size)\n");
698 printf(" [-m size] (minimum hash alloc size)\n");
699 printf(" [not -u nor -s] Add entries (supports redundant keys).\n");
700 printf(" [-u] Uniquify add (no redundant keys).\n");
701 printf(" [-s] Replace (swap) entries.\n");
702 printf(" [-i] Add only (no removal).\n");
703 printf(" [-k nr_nodes] Number of nodes to insert initially.\n");
704 printf(" [-A] Automatically resize hash table.\n");
705 printf(" [-R offset] Lookup pool offset.\n");
706 printf(" [-S offset] Write pool offset.\n");
707 printf(" [-T offset] Init pool offset.\n");
708 printf(" [-M size] Lookup pool size.\n");
709 printf(" [-N size] Write pool size.\n");
710 printf(" [-O size] Init pool size.\n");
711 printf(" [-V] Validate lookups of init values (use with filled init pool, same lookup range, with different write range).\n");
715 int main(int argc
, char **argv
)
718 pthread_t
*tid_reader
, *tid_writer
;
721 unsigned long long *count_reader
;
722 struct wr_count
*count_writer
;
723 unsigned long long tot_reads
= 0, tot_writes
= 0,
724 tot_add
= 0, tot_add_exist
= 0, tot_remove
= 0;
725 unsigned long count
, removed
;
726 long approx_before
, approx_after
;
728 struct sigaction act
;
732 show_usage(argc
, argv
);
736 err
= sscanf(argv
[1], "%u", &nr_readers
);
738 show_usage(argc
, argv
);
742 err
= sscanf(argv
[2], "%u", &nr_writers
);
744 show_usage(argc
, argv
);
748 err
= sscanf(argv
[3], "%lu", &duration
);
750 show_usage(argc
, argv
);
754 for (i
= 4; i
< argc
; i
++) {
755 if (argv
[i
][0] != '-')
757 switch (argv
[i
][1]) {
760 yield_active
|= YIELD_READ
;
763 yield_active
|= YIELD_WRITE
;
768 show_usage(argc
, argv
);
772 cpu_affinities
[next_aff
++] = a
;
774 printf_verbose("Adding CPU %d affinity\n", a
);
778 show_usage(argc
, argv
);
781 rduration
= atol(argv
[++i
]);
785 show_usage(argc
, argv
);
788 wdelay
= atol(argv
[++i
]);
795 show_usage(argc
, argv
);
798 init_hash_size
= atol(argv
[++i
]);
802 show_usage(argc
, argv
);
805 min_hash_alloc_size
= atol(argv
[++i
]);
809 printf("Please specify at most one of -s or -u.\n");
816 printf("Please specify at most one of -s or -u.\n");
825 init_populate
= atol(argv
[++i
]);
831 lookup_pool_offset
= atol(argv
[++i
]);
834 write_pool_offset
= atol(argv
[++i
]);
837 init_pool_offset
= atol(argv
[++i
]);
840 lookup_pool_size
= atol(argv
[++i
]);
843 write_pool_size
= atol(argv
[++i
]);
846 init_pool_size
= atol(argv
[++i
]);
855 /* Check if hash size is power of 2 */
856 if (init_hash_size
&& init_hash_size
& (init_hash_size
- 1)) {
857 printf("Error: Hash table size %lu is not a power of 2.\n",
862 if (min_hash_alloc_size
&& min_hash_alloc_size
* (min_hash_alloc_size
- 1)) {
863 printf("Error: Min hash alloc size %lu is not a power of 2.\n",
864 min_hash_alloc_size
);
868 memset(&act
, 0, sizeof(act
));
869 ret
= sigemptyset(&act
.sa_mask
);
871 perror("sigemptyset");
874 act
.sa_handler
= sigusr1_handler
;
875 act
.sa_flags
= SA_RESTART
;
876 ret
= sigaction(SIGUSR1
, &act
, NULL
);
882 ret
= pipe(count_pipe
);
888 /* spawn counter thread */
889 err
= pthread_create(&tid_count
, NULL
, thr_count
,
894 act
.sa_handler
= sigusr2_handler
;
895 act
.sa_flags
= SA_RESTART
;
896 ret
= sigaction(SIGUSR2
, &act
, NULL
);
902 printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
903 duration
, nr_readers
, nr_writers
);
904 printf_verbose("Writer delay : %lu loops.\n", wdelay
);
905 printf_verbose("Reader duration : %lu loops.\n", rduration
);
906 printf_verbose("Mode:%s%s.\n",
907 add_only
? " add only" : " add/remove",
908 add_unique
? " uniquify" : ( add_replace
? " replace" : " insert"));
909 printf_verbose("Initial hash table size: %lu buckets.\n", init_hash_size
);
910 printf_verbose("Minimum hash alloc size: %lu buckets.\n", min_hash_alloc_size
);
911 printf_verbose("Init pool size offset %lu size %lu.\n",
912 init_pool_offset
, init_pool_size
);
913 printf_verbose("Lookup pool size offset %lu size %lu.\n",
914 lookup_pool_offset
, lookup_pool_size
);
915 printf_verbose("Update pool size offset %lu size %lu.\n",
916 write_pool_offset
, write_pool_size
);
917 printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
918 "main", pthread_self(), (unsigned long)gettid());
920 tid_reader
= malloc(sizeof(*tid_reader
) * nr_readers
);
921 tid_writer
= malloc(sizeof(*tid_writer
) * nr_writers
);
922 count_reader
= malloc(sizeof(*count_reader
) * nr_readers
);
923 count_writer
= malloc(sizeof(*count_writer
) * nr_writers
);
925 err
= create_all_cpu_call_rcu_data(0);
929 * Hash creation and population needs to be seen as a RCU reader
930 * thread from the point of view of resize.
932 rcu_register_thread();
933 test_ht
= cds_lfht_new(test_hash
, test_compare
, 0x42UL
,
934 init_hash_size
, min_hash_alloc_size
,
935 (opt_auto_resize
? CDS_LFHT_AUTO_RESIZE
: 0) |
936 CDS_LFHT_ACCOUNTING
, NULL
);
937 ret
= populate_hash();
940 rcu_thread_offline();
944 for (i
= 0; i
< nr_readers
; i
++) {
945 err
= pthread_create(&tid_reader
[i
], NULL
, thr_reader
,
950 for (i
= 0; i
< nr_writers
; i
++) {
951 err
= pthread_create(&tid_writer
[i
], NULL
, thr_writer
,
963 remain
= sleep(remain
);
964 } while (remain
> 0);
968 for (i
= 0; i
< nr_readers
; i
++) {
969 err
= pthread_join(tid_reader
[i
], &tret
);
972 tot_reads
+= count_reader
[i
];
974 for (i
= 0; i
< nr_writers
; i
++) {
975 err
= pthread_join(tid_writer
[i
], &tret
);
978 tot_writes
+= count_writer
[i
].update_ops
;
979 tot_add
+= count_writer
[i
].add
;
980 tot_add_exist
+= count_writer
[i
].add_exist
;
981 tot_remove
+= count_writer
[i
].remove
;
984 /* teardown counter thread */
985 act
.sa_handler
= SIG_IGN
;
986 act
.sa_flags
= SA_RESTART
;
987 ret
= sigaction(SIGUSR2
, &act
, NULL
);
993 char msg
[1] = { 0x42 };
997 ret
= write(count_pipe
[1], msg
, 1); /* wakeup thread */
998 } while (ret
== -1L && errno
== EINTR
);
1000 err
= pthread_join(tid_count
, &tret
);
1005 rcu_thread_online();
1007 printf("Counting nodes... ");
1008 cds_lfht_count_nodes(test_ht
, &approx_before
, &count
, &removed
,
1011 test_delete_all_nodes(test_ht
);
1013 rcu_thread_offline();
1014 if (count
|| removed
) {
1015 printf("Approximation before node accounting: %ld nodes.\n",
1017 printf("Nodes deleted from hash table before destroy: "
1018 "%lu nodes + %lu logically removed.\n",
1020 printf("Approximation after node accounting: %ld nodes.\n",
1023 ret
= cds_lfht_destroy(test_ht
, NULL
);
1025 printf_verbose("final delete aborted\n");
1027 printf_verbose("final delete success\n");
1028 printf_verbose("total number of reads : %llu, writes %llu\n", tot_reads
,
1030 printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
1032 "wdelay %6lu nr_reads %12llu nr_writes %12llu nr_ops %12llu "
1033 "nr_add %12llu nr_add_fail %12llu nr_remove %12llu nr_leaked %12lld\n",
1034 argv
[0], duration
, nr_readers
, rduration
,
1035 nr_writers
, wdelay
, tot_reads
, tot_writes
,
1036 tot_reads
+ tot_writes
, tot_add
, tot_add_exist
, tot_remove
,
1037 (long long) tot_add
+ init_populate
- tot_remove
- count
);
1038 rcu_unregister_thread();
1039 free_all_cpu_call_rcu_data();