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
;
110 /* cache-cold for iteration */
111 struct rcu_head head
;
114 static inline struct lfht_test_node
*
115 to_test_node(struct cds_lfht_node
*node
)
117 return caa_container_of(node
, struct lfht_test_node
, node
);
121 void lfht_test_node_init(struct lfht_test_node
*node
, void *key
,
124 cds_lfht_node_init(&node
->node
, key
, key_len
);
127 static inline struct lfht_test_node
*
128 cds_lfht_iter_get_test_node(struct cds_lfht_iter
*iter
)
130 return to_test_node(cds_lfht_iter_get_node(iter
));
133 static volatile int test_go
, test_stop
;
135 static unsigned long wdelay
;
137 static unsigned long duration
;
139 /* read-side C.S. duration, in loops */
140 static unsigned long rduration
;
142 static unsigned long init_hash_size
= DEFAULT_HASH_SIZE
;
143 static unsigned long min_hash_alloc_size
= DEFAULT_MIN_ALLOC_SIZE
;
144 static unsigned long init_populate
;
145 static int opt_auto_resize
;
146 static int add_only
, add_unique
, add_replace
;
148 static unsigned long init_pool_offset
, lookup_pool_offset
, write_pool_offset
;
149 static unsigned long init_pool_size
= DEFAULT_RAND_POOL
,
150 lookup_pool_size
= DEFAULT_RAND_POOL
,
151 write_pool_size
= DEFAULT_RAND_POOL
;
152 static int validate_lookup
;
154 static int count_pipe
[2];
156 static inline void loop_sleep(unsigned long l
)
162 static int verbose_mode
;
164 #define printf_verbose(fmt, args...) \
167 printf(fmt, ## args); \
170 static unsigned int cpu_affinities
[NR_CPUS
];
171 static unsigned int next_aff
= 0;
172 static int use_affinity
= 0;
174 pthread_mutex_t affinity_mutex
= PTHREAD_MUTEX_INITIALIZER
;
176 static void set_affinity(void)
185 ret
= pthread_mutex_lock(&affinity_mutex
);
187 perror("Error in pthread mutex lock");
190 cpu
= cpu_affinities
[next_aff
++];
191 ret
= pthread_mutex_unlock(&affinity_mutex
);
193 perror("Error in pthread mutex unlock");
198 sched_setaffinity(0, sizeof(mask
), &mask
);
205 } addremove
; /* 1: add, -1 remove, 0: random */
208 void sigusr1_handler(int signo
)
212 printf("Add/Remove: random.\n");
213 addremove
= AR_RANDOM
;
216 printf("Add/Remove: remove only.\n");
217 addremove
= AR_REMOVE
;
220 printf("Add/Remove: add only.\n");
227 void sigusr2_handler(int signo
)
229 char msg
[1] = { 0x42 };
233 ret
= write(count_pipe
[1], msg
, 1); /* wakeup thread */
234 } while (ret
== -1L && errno
== EINTR
);
238 * returns 0 if test should end.
240 static int test_duration_write(void)
245 static int test_duration_read(void)
250 static unsigned long long __thread nr_writes
;
251 static unsigned long long __thread nr_reads
;
253 static unsigned int nr_readers
;
254 static unsigned int nr_writers
;
256 pthread_mutex_t rcu_copy_mutex
= PTHREAD_MUTEX_INITIALIZER
;
258 void rcu_copy_mutex_lock(void)
261 ret
= pthread_mutex_lock(&rcu_copy_mutex
);
263 perror("Error in pthread mutex lock");
268 void rcu_copy_mutex_unlock(void)
272 ret
= pthread_mutex_unlock(&rcu_copy_mutex
);
274 perror("Error in pthread mutex unlock");
281 * Source: http://burtleburtle.net/bob/c/lookup3.c
282 * Originally Public Domain
285 #define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
287 #define mix(a, b, c) \
289 a -= c; a ^= rot(c, 4); c += b; \
290 b -= a; b ^= rot(a, 6); a += c; \
291 c -= b; c ^= rot(b, 8); b += a; \
292 a -= c; a ^= rot(c, 16); c += b; \
293 b -= a; b ^= rot(a, 19); a += c; \
294 c -= b; c ^= rot(b, 4); b += a; \
297 #define final(a, b, c) \
299 c ^= b; c -= rot(b, 14); \
300 a ^= c; a -= rot(c, 11); \
301 b ^= a; b -= rot(a, 25); \
302 c ^= b; c -= rot(b, 16); \
303 a ^= c; a -= rot(c, 4);\
304 b ^= a; b -= rot(a, 14); \
305 c ^= b; c -= rot(b, 24); \
308 static __attribute__((unused
))
310 const uint32_t *k
, /* the key, an array of uint32_t values */
311 size_t length
, /* the length of the key, in uint32_ts */
312 uint32_t initval
) /* the previous hash, or an arbitrary value */
316 /* Set up the internal state */
317 a
= b
= c
= 0xdeadbeef + (((uint32_t) length
) << 2) + initval
;
319 /*----------------------------------------- handle most of the key */
329 /*----------------------------------- handle the last 3 uint32_t's */
330 switch (length
) { /* all the case statements fall through */
335 case 0: /* case 0: nothing left to add */
338 /*---------------------------------------------- report the result */
344 const uint32_t *k
, /* the key, an array of uint32_t values */
345 size_t length
, /* the length of the key, in uint32_ts */
346 uint32_t *pc
, /* IN: seed OUT: primary hash value */
347 uint32_t *pb
) /* IN: more seed OUT: secondary hash value */
351 /* Set up the internal state */
352 a
= b
= c
= 0xdeadbeef + ((uint32_t) (length
<< 2)) + *pc
;
355 /*----------------------------------------- handle most of the key */
365 /*----------------------------------- handle the last 3 uint32_t's */
366 switch (length
) { /* all the case statements fall through */
371 case 0: /* case 0: nothing left to add */
374 /*---------------------------------------------- report the result */
379 #if (CAA_BITS_PER_LONG == 32)
381 unsigned long test_hash(void *_key
, size_t length
, unsigned long seed
)
383 unsigned int key
= (unsigned int) _key
;
385 assert(length
== sizeof(unsigned int));
386 return hash_u32(&key
, 1, seed
);
390 unsigned long test_hash(void *_key
, size_t length
, unsigned long seed
)
401 assert(length
== sizeof(unsigned long));
402 v
.v64
= (uint64_t) seed
;
403 key
.v64
= (uint64_t) _key
;
404 hashword2(key
.v32
, 2, &v
.v32
[0], &v
.v32
[1]);
410 unsigned long test_compare(void *key1
, size_t key1_len
,
411 void *key2
, size_t key2_len
)
413 if (caa_unlikely(key1_len
!= key2_len
))
415 assert(key1_len
== sizeof(unsigned long));
422 void *thr_count(void *arg
)
424 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
425 "counter", pthread_self(), (unsigned long)gettid());
427 rcu_register_thread();
430 unsigned long count
, removed
;
431 long approx_before
, approx_after
;
435 rcu_thread_offline();
436 len
= read(count_pipe
[0], buf
, 1);
438 if (caa_unlikely(!test_duration_read()))
443 printf("Counting nodes... ");
446 cds_lfht_count_nodes(test_ht
, &approx_before
, &count
, &removed
,
450 printf("Approximation before node accounting: %ld nodes.\n",
452 printf("Accounting of nodes in the hash table: "
453 "%lu nodes + %lu logically removed.\n",
455 printf("Approximation after node accounting: %ld nodes.\n",
458 rcu_unregister_thread();
462 void *thr_reader(void *_count
)
464 unsigned long long *count
= _count
;
465 struct lfht_test_node
*node
;
466 struct cds_lfht_iter iter
;
468 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
469 "reader", pthread_self(), (unsigned long)gettid());
473 rcu_register_thread();
482 cds_lfht_lookup(test_ht
,
483 (void *)(((unsigned long) rand_r(&rand_lookup
) % lookup_pool_size
) + lookup_pool_offset
),
484 sizeof(void *), &iter
);
485 node
= cds_lfht_iter_get_test_node(&iter
);
487 if (validate_lookup
) {
488 printf("[ERROR] Lookup cannot find initial node.\n");
496 if (caa_unlikely(rduration
))
497 loop_sleep(rduration
);
500 if (caa_unlikely(!test_duration_read()))
502 if (caa_unlikely((nr_reads
& ((1 << 10) - 1)) == 0))
503 rcu_quiescent_state();
506 rcu_unregister_thread();
509 printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
510 "reader", pthread_self(), (unsigned long)gettid());
511 printf_verbose("readid : %lx, lookupfail %lu, lookupok %lu\n",
512 pthread_self(), lookup_fail
, lookup_ok
);
518 void free_node_cb(struct rcu_head
*head
)
520 struct lfht_test_node
*node
=
521 caa_container_of(head
, struct lfht_test_node
, head
);
525 void *thr_writer(void *_count
)
527 struct lfht_test_node
*node
;
528 struct cds_lfht_node
*ret_node
;
529 struct cds_lfht_iter iter
;
530 struct wr_count
*count
= _count
;
533 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
534 "writer", pthread_self(), (unsigned long)gettid());
538 rcu_register_thread();
546 if ((addremove
== AR_ADD
|| add_only
)
547 || (addremove
== AR_RANDOM
&& rand_r(&rand_lookup
) & 1)) {
548 node
= malloc(sizeof(struct lfht_test_node
));
549 lfht_test_node_init(node
,
550 (void *)(((unsigned long) rand_r(&rand_lookup
) % write_pool_size
) + write_pool_offset
),
554 ret_node
= cds_lfht_add_unique(test_ht
, &node
->node
);
557 ret_node
= cds_lfht_add_replace(test_ht
, &node
->node
);
559 cds_lfht_add(test_ht
, &node
->node
);
562 if (add_unique
&& ret_node
!= &node
->node
) {
566 if (add_replace
&& ret_node
) {
567 call_rcu(&to_test_node(ret_node
)->head
,
577 cds_lfht_lookup(test_ht
,
578 (void *)(((unsigned long) rand_r(&rand_lookup
) % write_pool_size
) + write_pool_offset
),
579 sizeof(void *), &iter
);
580 ret
= cds_lfht_del(test_ht
, &iter
);
583 node
= cds_lfht_iter_get_test_node(&iter
);
584 call_rcu(&node
->head
, free_node_cb
);
590 //if (nr_writes % 100000 == 0) {
591 if (nr_writes
% 1000 == 0) {
593 if (rand_r(&rand_lookup
) & 1) {
594 ht_resize(test_ht
, 1);
596 ht_resize(test_ht
, -1);
602 if (caa_unlikely(!test_duration_write()))
604 if (caa_unlikely(wdelay
))
606 if (caa_unlikely((nr_writes
& ((1 << 10) - 1)) == 0))
607 rcu_quiescent_state();
610 rcu_unregister_thread();
612 printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
613 "writer", pthread_self(), (unsigned long)gettid());
614 printf_verbose("info id %lx: nr_add %lu, nr_addexist %lu, nr_del %lu, "
615 "nr_delnoent %lu\n", pthread_self(), nr_add
,
616 nr_addexist
, nr_del
, nr_delnoent
);
617 count
->update_ops
= nr_writes
;
619 count
->add_exist
= nr_addexist
;
620 count
->remove
= nr_del
;
624 static int populate_hash(void)
626 struct lfht_test_node
*node
;
627 struct cds_lfht_node
*ret_node
;
632 if ((add_unique
|| add_replace
) && init_populate
* 10 > init_pool_size
) {
633 printf("WARNING: required to populate %lu nodes (-k), but random "
634 "pool is quite small (%lu values) and we are in add_unique (-u) or add_replace (-s) mode. Try with a "
635 "larger random pool (-p option). This may take a while...\n", init_populate
, init_pool_size
);
638 while (nr_add
< init_populate
) {
639 node
= malloc(sizeof(struct lfht_test_node
));
640 lfht_test_node_init(node
,
641 (void *)(((unsigned long) rand_r(&rand_lookup
) % init_pool_size
) + init_pool_offset
),
645 ret_node
= cds_lfht_add_unique(test_ht
, &node
->node
);
648 ret_node
= cds_lfht_add_replace(test_ht
, &node
->node
);
650 cds_lfht_add(test_ht
, &node
->node
);
653 if (add_unique
&& ret_node
!= &node
->node
) {
657 if (add_replace
&& ret_node
) {
658 call_rcu(&to_test_node(ret_node
)->head
, free_node_cb
);
670 void test_delete_all_nodes(struct cds_lfht
*ht
)
672 struct cds_lfht_iter iter
;
673 struct lfht_test_node
*node
;
674 unsigned long count
= 0;
676 cds_lfht_first(ht
, &iter
);
677 while ((node
= cds_lfht_iter_get_test_node(&iter
)) != NULL
) {
680 ret
= cds_lfht_del(test_ht
, &iter
);
682 call_rcu(&node
->head
, free_node_cb
);
683 cds_lfht_next(ht
, &iter
);
686 printf("deleted %lu nodes.\n", count
);
689 void show_usage(int argc
, char **argv
)
691 printf("Usage : %s nr_readers nr_writers duration (s)\n", argv
[0]);
693 printf(" [-r] [-w] (yield reader and/or writer)\n");
695 printf(" [-d delay] (writer period (us))\n");
696 printf(" [-c duration] (reader C.S. duration (in loops))\n");
697 printf(" [-v] (verbose output)\n");
698 printf(" [-a cpu#] [-a cpu#]... (affinity)\n");
699 printf(" [-h size] (initial hash table size)\n");
700 printf(" [-m size] (minimum hash alloc size)\n");
701 printf(" [not -u nor -s] Add entries (supports redundant keys).\n");
702 printf(" [-u] Uniquify add (no redundant keys).\n");
703 printf(" [-s] Replace (swap) entries.\n");
704 printf(" [-i] Add only (no removal).\n");
705 printf(" [-k nr_nodes] Number of nodes to insert initially.\n");
706 printf(" [-A] Automatically resize hash table.\n");
707 printf(" [-R offset] Lookup pool offset.\n");
708 printf(" [-S offset] Write pool offset.\n");
709 printf(" [-T offset] Init pool offset.\n");
710 printf(" [-M size] Lookup pool size.\n");
711 printf(" [-N size] Write pool size.\n");
712 printf(" [-O size] Init pool size.\n");
713 printf(" [-V] Validate lookups of init values (use with filled init pool, same lookup range, with different write range).\n");
717 int main(int argc
, char **argv
)
720 pthread_t
*tid_reader
, *tid_writer
;
723 unsigned long long *count_reader
;
724 struct wr_count
*count_writer
;
725 unsigned long long tot_reads
= 0, tot_writes
= 0,
726 tot_add
= 0, tot_add_exist
= 0, tot_remove
= 0;
727 unsigned long count
, removed
;
728 long approx_before
, approx_after
;
730 struct sigaction act
;
734 show_usage(argc
, argv
);
738 err
= sscanf(argv
[1], "%u", &nr_readers
);
740 show_usage(argc
, argv
);
744 err
= sscanf(argv
[2], "%u", &nr_writers
);
746 show_usage(argc
, argv
);
750 err
= sscanf(argv
[3], "%lu", &duration
);
752 show_usage(argc
, argv
);
756 for (i
= 4; i
< argc
; i
++) {
757 if (argv
[i
][0] != '-')
759 switch (argv
[i
][1]) {
762 yield_active
|= YIELD_READ
;
765 yield_active
|= YIELD_WRITE
;
770 show_usage(argc
, argv
);
774 cpu_affinities
[next_aff
++] = a
;
776 printf_verbose("Adding CPU %d affinity\n", a
);
780 show_usage(argc
, argv
);
783 rduration
= atol(argv
[++i
]);
787 show_usage(argc
, argv
);
790 wdelay
= atol(argv
[++i
]);
797 show_usage(argc
, argv
);
800 init_hash_size
= atol(argv
[++i
]);
804 show_usage(argc
, argv
);
807 min_hash_alloc_size
= atol(argv
[++i
]);
811 printf("Please specify at most one of -s or -u.\n");
818 printf("Please specify at most one of -s or -u.\n");
827 init_populate
= atol(argv
[++i
]);
833 lookup_pool_offset
= atol(argv
[++i
]);
836 write_pool_offset
= atol(argv
[++i
]);
839 init_pool_offset
= atol(argv
[++i
]);
842 lookup_pool_size
= atol(argv
[++i
]);
845 write_pool_size
= atol(argv
[++i
]);
848 init_pool_size
= atol(argv
[++i
]);
857 /* Check if hash size is power of 2 */
858 if (init_hash_size
&& init_hash_size
& (init_hash_size
- 1)) {
859 printf("Error: Hash table size %lu is not a power of 2.\n",
864 if (min_hash_alloc_size
&& min_hash_alloc_size
* (min_hash_alloc_size
- 1)) {
865 printf("Error: Min hash alloc size %lu is not a power of 2.\n",
866 min_hash_alloc_size
);
870 memset(&act
, 0, sizeof(act
));
871 ret
= sigemptyset(&act
.sa_mask
);
873 perror("sigemptyset");
876 act
.sa_handler
= sigusr1_handler
;
877 act
.sa_flags
= SA_RESTART
;
878 ret
= sigaction(SIGUSR1
, &act
, NULL
);
884 ret
= pipe(count_pipe
);
890 /* spawn counter thread */
891 err
= pthread_create(&tid_count
, NULL
, thr_count
,
896 act
.sa_handler
= sigusr2_handler
;
897 act
.sa_flags
= SA_RESTART
;
898 ret
= sigaction(SIGUSR2
, &act
, NULL
);
904 printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
905 duration
, nr_readers
, nr_writers
);
906 printf_verbose("Writer delay : %lu loops.\n", wdelay
);
907 printf_verbose("Reader duration : %lu loops.\n", rduration
);
908 printf_verbose("Mode:%s%s.\n",
909 add_only
? " add only" : " add/remove",
910 add_unique
? " uniquify" : ( add_replace
? " replace" : " insert"));
911 printf_verbose("Initial hash table size: %lu buckets.\n", init_hash_size
);
912 printf_verbose("Minimum hash alloc size: %lu buckets.\n", min_hash_alloc_size
);
913 printf_verbose("Init pool size offset %lu size %lu.\n",
914 init_pool_offset
, init_pool_size
);
915 printf_verbose("Lookup pool size offset %lu size %lu.\n",
916 lookup_pool_offset
, lookup_pool_size
);
917 printf_verbose("Update pool size offset %lu size %lu.\n",
918 write_pool_offset
, write_pool_size
);
919 printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
920 "main", pthread_self(), (unsigned long)gettid());
922 tid_reader
= malloc(sizeof(*tid_reader
) * nr_readers
);
923 tid_writer
= malloc(sizeof(*tid_writer
) * nr_writers
);
924 count_reader
= malloc(sizeof(*count_reader
) * nr_readers
);
925 count_writer
= malloc(sizeof(*count_writer
) * nr_writers
);
927 err
= create_all_cpu_call_rcu_data(0);
931 * Hash creation and population needs to be seen as a RCU reader
932 * thread from the point of view of resize.
934 rcu_register_thread();
935 test_ht
= cds_lfht_new(test_hash
, test_compare
, 0x42UL
,
936 init_hash_size
, min_hash_alloc_size
,
937 (opt_auto_resize
? CDS_LFHT_AUTO_RESIZE
: 0) |
938 CDS_LFHT_ACCOUNTING
, NULL
);
939 ret
= populate_hash();
942 rcu_thread_offline();
946 for (i
= 0; i
< nr_readers
; i
++) {
947 err
= pthread_create(&tid_reader
[i
], NULL
, thr_reader
,
952 for (i
= 0; i
< nr_writers
; i
++) {
953 err
= pthread_create(&tid_writer
[i
], NULL
, thr_writer
,
965 remain
= sleep(remain
);
966 } while (remain
> 0);
970 for (i
= 0; i
< nr_readers
; i
++) {
971 err
= pthread_join(tid_reader
[i
], &tret
);
974 tot_reads
+= count_reader
[i
];
976 for (i
= 0; i
< nr_writers
; i
++) {
977 err
= pthread_join(tid_writer
[i
], &tret
);
980 tot_writes
+= count_writer
[i
].update_ops
;
981 tot_add
+= count_writer
[i
].add
;
982 tot_add_exist
+= count_writer
[i
].add_exist
;
983 tot_remove
+= count_writer
[i
].remove
;
986 /* teardown counter thread */
987 act
.sa_handler
= SIG_IGN
;
988 act
.sa_flags
= SA_RESTART
;
989 ret
= sigaction(SIGUSR2
, &act
, NULL
);
995 char msg
[1] = { 0x42 };
999 ret
= write(count_pipe
[1], msg
, 1); /* wakeup thread */
1000 } while (ret
== -1L && errno
== EINTR
);
1002 err
= pthread_join(tid_count
, &tret
);
1007 rcu_thread_online();
1009 printf("Counting nodes... ");
1010 cds_lfht_count_nodes(test_ht
, &approx_before
, &count
, &removed
,
1013 test_delete_all_nodes(test_ht
);
1015 rcu_thread_offline();
1016 if (count
|| removed
) {
1017 printf("Approximation before node accounting: %ld nodes.\n",
1019 printf("Nodes deleted from hash table before destroy: "
1020 "%lu nodes + %lu logically removed.\n",
1022 printf("Approximation after node accounting: %ld nodes.\n",
1025 ret
= cds_lfht_destroy(test_ht
, NULL
);
1027 printf_verbose("final delete aborted\n");
1029 printf_verbose("final delete success\n");
1030 printf_verbose("total number of reads : %llu, writes %llu\n", tot_reads
,
1032 printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
1034 "wdelay %6lu nr_reads %12llu nr_writes %12llu nr_ops %12llu "
1035 "nr_add %12llu nr_add_fail %12llu nr_remove %12llu nr_leaked %12lld\n",
1036 argv
[0], duration
, nr_readers
, rduration
,
1037 nr_writers
, wdelay
, tot_reads
, tot_writes
,
1038 tot_reads
+ tot_writes
, tot_add
, tot_add_exist
, tot_remove
,
1039 (long long) tot_add
+ init_populate
- tot_remove
- count
);
1040 rcu_unregister_thread();
1041 free_all_cpu_call_rcu_data();