959749568d5589022d4bab6a63fea7a924770cc4
[urcu.git] / tests / test_urcu_hash.c
1 /*
2 * test_urcu_hash.c
3 *
4 * Userspace RCU library - test program
5 *
6 * Copyright February 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
7 *
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.
12 *
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.
17 *
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.
21 */
22
23 #define _GNU_SOURCE
24 #include <stdio.h>
25 #include <pthread.h>
26 #include <stdlib.h>
27 #include <string.h>
28 #include <sys/types.h>
29 #include <sys/wait.h>
30 #include <unistd.h>
31 #include <stdio.h>
32 #include <assert.h>
33 #include <sched.h>
34 #include <errno.h>
35
36 #ifdef __linux__
37 #include <syscall.h>
38 #endif
39
40 #define DEFAULT_HASH_SIZE 32
41 #define DEFAULT_RAND_POOL 1000000
42
43 /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
44 #define CACHE_LINE_SIZE 4096
45
46 /* hardcoded number of CPUs */
47 #define NR_CPUS 16384
48
49 #ifdef POISON_FREE
50 #define poison_free(ptr) \
51 do { \
52 memset(ptr, 0x42, sizeof(*(ptr))); \
53 free(ptr); \
54 } while (0)
55 #else
56 #define poison_free(ptr) free(ptr)
57 #endif
58
59
60
61 #if defined(_syscall0)
62 _syscall0(pid_t, gettid)
63 #elif defined(__NR_gettid)
64 static inline pid_t gettid(void)
65 {
66 return syscall(__NR_gettid);
67 }
68 #else
69 #warning "use pid as tid"
70 static inline pid_t gettid(void)
71 {
72 return getpid();
73 }
74 #endif
75
76 #ifndef DYNAMIC_LINK_TEST
77 #define _LGPL_SOURCE
78 #else
79 #define debug_yield_read()
80 #endif
81 #include <urcu-qsbr.h>
82 #include <urcu/rculfhash.h>
83 #include <urcu-call-rcu.h>
84
85 struct wr_count {
86 unsigned long update_ops;
87 unsigned long add;
88 unsigned long add_exist;
89 unsigned long remove;
90 };
91
92 static unsigned int __thread rand_lookup;
93 static unsigned long __thread nr_add;
94 static unsigned long __thread nr_addexist;
95 static unsigned long __thread nr_del;
96 static unsigned long __thread nr_delnoent;
97 static unsigned long __thread lookup_fail;
98 static unsigned long __thread lookup_ok;
99
100 static struct cds_lfht *test_ht;
101
102 struct test_data {
103 int a;
104 int b;
105 };
106
107 static volatile int test_go, test_stop;
108
109 static unsigned long wdelay;
110
111 static unsigned long duration;
112
113 /* read-side C.S. duration, in loops */
114 static unsigned long rduration;
115
116 static unsigned long init_hash_size = DEFAULT_HASH_SIZE;
117 static unsigned long init_populate;
118 static unsigned long rand_pool = DEFAULT_RAND_POOL;
119 static int opt_auto_resize;
120 static int add_only, add_unique;
121
122 static inline void loop_sleep(unsigned long l)
123 {
124 while(l-- != 0)
125 caa_cpu_relax();
126 }
127
128 static int verbose_mode;
129
130 #define printf_verbose(fmt, args...) \
131 do { \
132 if (verbose_mode) \
133 printf(fmt, ## args); \
134 } while (0)
135
136 static unsigned int cpu_affinities[NR_CPUS];
137 static unsigned int next_aff = 0;
138 static int use_affinity = 0;
139
140 pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER;
141
142 static void set_affinity(void)
143 {
144 cpu_set_t mask;
145 int cpu;
146 int ret;
147
148 if (!use_affinity)
149 return;
150
151 ret = pthread_mutex_lock(&affinity_mutex);
152 if (ret) {
153 perror("Error in pthread mutex lock");
154 exit(-1);
155 }
156 cpu = cpu_affinities[next_aff++];
157 ret = pthread_mutex_unlock(&affinity_mutex);
158 if (ret) {
159 perror("Error in pthread mutex unlock");
160 exit(-1);
161 }
162 CPU_ZERO(&mask);
163 CPU_SET(cpu, &mask);
164 sched_setaffinity(0, sizeof(mask), &mask);
165 }
166
167 static enum {
168 AR_RANDOM = 0,
169 AR_ADD = 1,
170 AR_REMOVE = -1,
171 } addremove; /* 1: add, -1 remove, 0: random */
172
173 static
174 void sigusr1_handler(int signo)
175 {
176 switch (addremove) {
177 case AR_ADD:
178 printf("Add/Remove: random.\n");
179 addremove = AR_RANDOM;
180 break;
181 case AR_RANDOM:
182 printf("Add/Remove: remove only.\n");
183 addremove = AR_REMOVE;
184 break;
185 case AR_REMOVE:
186 printf("Add/Remove: add only.\n");
187 addremove = AR_ADD;
188 break;
189 }
190 }
191
192 /*
193 * returns 0 if test should end.
194 */
195 static int test_duration_write(void)
196 {
197 return !test_stop;
198 }
199
200 static int test_duration_read(void)
201 {
202 return !test_stop;
203 }
204
205 static unsigned long long __thread nr_writes;
206 static unsigned long long __thread nr_reads;
207
208 static unsigned int nr_readers;
209 static unsigned int nr_writers;
210
211 pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
212
213 void rcu_copy_mutex_lock(void)
214 {
215 int ret;
216 ret = pthread_mutex_lock(&rcu_copy_mutex);
217 if (ret) {
218 perror("Error in pthread mutex lock");
219 exit(-1);
220 }
221 }
222
223 void rcu_copy_mutex_unlock(void)
224 {
225 int ret;
226
227 ret = pthread_mutex_unlock(&rcu_copy_mutex);
228 if (ret) {
229 perror("Error in pthread mutex unlock");
230 exit(-1);
231 }
232 }
233
234 /*
235 * Hash function
236 * Source: http://burtleburtle.net/bob/c/lookup3.c
237 * Originally Public Domain
238 */
239
240 #define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
241
242 #define mix(a, b, c) \
243 do { \
244 a -= c; a ^= rot(c, 4); c += b; \
245 b -= a; b ^= rot(a, 6); a += c; \
246 c -= b; c ^= rot(b, 8); b += a; \
247 a -= c; a ^= rot(c, 16); c += b; \
248 b -= a; b ^= rot(a, 19); a += c; \
249 c -= b; c ^= rot(b, 4); b += a; \
250 } while (0)
251
252 #define final(a, b, c) \
253 { \
254 c ^= b; c -= rot(b, 14); \
255 a ^= c; a -= rot(c, 11); \
256 b ^= a; b -= rot(a, 25); \
257 c ^= b; c -= rot(b, 16); \
258 a ^= c; a -= rot(c, 4);\
259 b ^= a; b -= rot(a, 14); \
260 c ^= b; c -= rot(b, 24); \
261 }
262
263 static __attribute__((unused))
264 uint32_t hash_u32(
265 const uint32_t *k, /* the key, an array of uint32_t values */
266 size_t length, /* the length of the key, in uint32_ts */
267 uint32_t initval) /* the previous hash, or an arbitrary value */
268 {
269 uint32_t a, b, c;
270
271 /* Set up the internal state */
272 a = b = c = 0xdeadbeef + (((uint32_t) length) << 2) + initval;
273
274 /*----------------------------------------- handle most of the key */
275 while (length > 3) {
276 a += k[0];
277 b += k[1];
278 c += k[2];
279 mix(a, b, c);
280 length -= 3;
281 k += 3;
282 }
283
284 /*----------------------------------- handle the last 3 uint32_t's */
285 switch (length) { /* all the case statements fall through */
286 case 3: c += k[2];
287 case 2: b += k[1];
288 case 1: a += k[0];
289 final(a, b, c);
290 case 0: /* case 0: nothing left to add */
291 break;
292 }
293 /*---------------------------------------------- report the result */
294 return c;
295 }
296
297 static
298 void hashword2(
299 const uint32_t *k, /* the key, an array of uint32_t values */
300 size_t length, /* the length of the key, in uint32_ts */
301 uint32_t *pc, /* IN: seed OUT: primary hash value */
302 uint32_t *pb) /* IN: more seed OUT: secondary hash value */
303 {
304 uint32_t a, b, c;
305
306 /* Set up the internal state */
307 a = b = c = 0xdeadbeef + ((uint32_t) (length << 2)) + *pc;
308 c += *pb;
309
310 /*----------------------------------------- handle most of the key */
311 while (length > 3) {
312 a += k[0];
313 b += k[1];
314 c += k[2];
315 mix(a, b, c);
316 length -= 3;
317 k += 3;
318 }
319
320 /*----------------------------------- handle the last 3 uint32_t's */
321 switch (length) { /* all the case statements fall through */
322 case 3: c += k[2];
323 case 2: b += k[1];
324 case 1: a += k[0];
325 final(a, b, c);
326 case 0: /* case 0: nothing left to add */
327 break;
328 }
329 /*---------------------------------------------- report the result */
330 *pc = c;
331 *pb = b;
332 }
333
334 #if (CAA_BITS_PER_LONG == 32)
335 static
336 unsigned long test_hash(void *_key, size_t length, unsigned long seed)
337 {
338 unsigned long key = (unsigned long) _key;
339 unsigned long v;
340
341 assert(length == sizeof(unsigned long));
342 return hash_u32(&v, 1, seed);
343 }
344 #else
345 static
346 unsigned long test_hash(void *_key, size_t length, unsigned long seed)
347 {
348 union {
349 uint64_t v64;
350 uint32_t v32[2];
351 } v;
352 union {
353 uint64_t v64;
354 uint32_t v32[2];
355 } key;
356
357 assert(length == sizeof(unsigned long));
358 v.v64 = (uint64_t) seed;
359 key.v64 = (uint64_t) _key;
360 hashword2(key.v32, 2, &v.v32[0], &v.v32[1]);
361 return v.v64;
362 }
363 #endif
364
365 static
366 unsigned long test_compare(void *key1, size_t key1_len,
367 void *key2, size_t key2_len)
368 {
369 if (unlikely(key1_len != key2_len))
370 return -1;
371 assert(key1_len == sizeof(unsigned long));
372 if (key1 == key2)
373 return 0;
374 else
375 return 1;
376 }
377
378 void *thr_reader(void *_count)
379 {
380 unsigned long long *count = _count;
381 struct cds_lfht_node *node;
382
383 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
384 "reader", pthread_self(), (unsigned long)gettid());
385
386 set_affinity();
387
388 rcu_register_thread();
389
390 while (!test_go)
391 {
392 }
393 cmm_smp_mb();
394
395 for (;;) {
396 rcu_read_lock();
397 node = cds_lfht_lookup(test_ht,
398 (void *)(unsigned long)(rand_r(&rand_lookup) % rand_pool),
399 sizeof(void *));
400 if (node == NULL)
401 lookup_fail++;
402 else
403 lookup_ok++;
404 debug_yield_read();
405 if (unlikely(rduration))
406 loop_sleep(rduration);
407 rcu_read_unlock();
408 nr_reads++;
409 if (unlikely(!test_duration_read()))
410 break;
411 if (unlikely((nr_reads & ((1 << 10) - 1)) == 0))
412 rcu_quiescent_state();
413 }
414
415 rcu_unregister_thread();
416
417 *count = nr_reads;
418 printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
419 "reader", pthread_self(), (unsigned long)gettid());
420 printf_verbose("readid : %lx, lookupfail %lu, lookupok %lu\n",
421 pthread_self(), lookup_fail, lookup_ok);
422 return ((void*)1);
423
424 }
425
426 static
427 void free_node_cb(struct rcu_head *head)
428 {
429 struct cds_lfht_node *node =
430 caa_container_of(head, struct cds_lfht_node, head);
431 free(node);
432 }
433
434 void *thr_writer(void *_count)
435 {
436 struct cds_lfht_node *node, *ret_node;
437 struct wr_count *count = _count;
438 int ret;
439
440 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
441 "writer", pthread_self(), (unsigned long)gettid());
442
443 set_affinity();
444
445 rcu_register_thread();
446
447 while (!test_go)
448 {
449 }
450 cmm_smp_mb();
451
452 for (;;) {
453 if ((addremove == AR_ADD || add_only)
454 || (addremove == AR_RANDOM && rand_r(&rand_lookup) & 1)) {
455 node = malloc(sizeof(struct cds_lfht_node));
456 rcu_read_lock();
457 cds_lfht_node_init(node,
458 (void *)(unsigned long)(rand_r(&rand_lookup) % rand_pool),
459 sizeof(void *));
460 if (add_unique)
461 ret_node = cds_lfht_add_unique(test_ht, node);
462 else
463 cds_lfht_add(test_ht, node);
464 rcu_read_unlock();
465 if (add_unique && ret_node != node) {
466 free(node);
467 nr_addexist++;
468 } else
469 nr_add++;
470 } else {
471 /* May delete */
472 rcu_read_lock();
473 node = cds_lfht_lookup(test_ht,
474 (void *)(unsigned long)(rand_r(&rand_lookup) % rand_pool),
475 sizeof(void *));
476 if (node)
477 ret = cds_lfht_remove(test_ht, node);
478 else
479 ret = -ENOENT;
480 rcu_read_unlock();
481 if (ret == 0) {
482 call_rcu(&node->head, free_node_cb);
483 nr_del++;
484 } else
485 nr_delnoent++;
486 }
487 #if 0
488 //if (nr_writes % 100000 == 0) {
489 if (nr_writes % 1000 == 0) {
490 rcu_read_lock();
491 if (rand_r(&rand_lookup) & 1) {
492 ht_resize(test_ht, 1);
493 } else {
494 ht_resize(test_ht, -1);
495 }
496 rcu_read_unlock();
497 }
498 #endif //0
499 nr_writes++;
500 if (unlikely(!test_duration_write()))
501 break;
502 if (unlikely(wdelay))
503 loop_sleep(wdelay);
504 if (unlikely((nr_writes & ((1 << 10) - 1)) == 0))
505 rcu_quiescent_state();
506 }
507
508 rcu_unregister_thread();
509
510 printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
511 "writer", pthread_self(), (unsigned long)gettid());
512 printf_verbose("info id %lx: nr_add %lu, nr_addexist %lu, nr_del %lu, "
513 "nr_delnoent %lu\n", pthread_self(), nr_add,
514 nr_addexist, nr_del, nr_delnoent);
515 count->update_ops = nr_writes;
516 count->add = nr_add;
517 count->add_exist = nr_addexist;
518 count->remove = nr_del;
519 return ((void*)2);
520 }
521
522 static int populate_hash(void)
523 {
524 struct cds_lfht_node *node, *ret_node;
525
526 if (!init_populate)
527 return 0;
528
529 if (add_unique && init_populate * 10 > rand_pool) {
530 printf("WARNING: required to populate %lu nodes (-k), but random "
531 "pool is quite small (%lu values) and we are in add_unique (-u) mode. Try with a "
532 "larger random pool (-p option).\n", init_populate, rand_pool);
533 return -1;
534 }
535
536 while (nr_add < init_populate) {
537 node = malloc(sizeof(struct cds_lfht_node));
538 cds_lfht_node_init(node,
539 (void *)(unsigned long)(rand_r(&rand_lookup) % rand_pool),
540 sizeof(void *));
541 if (add_unique)
542 ret_node = cds_lfht_add_unique(test_ht, node);
543 else
544 cds_lfht_add(test_ht, node);
545 if (add_unique && ret_node != node) {
546 free(node);
547 nr_addexist++;
548 } else
549 nr_add++;
550 nr_writes++;
551 }
552 return 0;
553 }
554
555 void show_usage(int argc, char **argv)
556 {
557 printf("Usage : %s nr_readers nr_writers duration (s)", argv[0]);
558 #ifdef DEBUG_YIELD
559 printf(" [-r] [-w] (yield reader and/or writer)");
560 #endif
561 printf(" [-d delay] (writer period (us))");
562 printf(" [-c duration] (reader C.S. duration (in loops))");
563 printf(" [-v] (verbose output)");
564 printf(" [-a cpu#] [-a cpu#]... (affinity)");
565 printf(" [-p size] (random key value pool size)");
566 printf(" [-h size] (initial hash table size)");
567 printf(" [-u] Uniquify add.");
568 printf(" [-i] Add only (no removal).");
569 printf(" [-k nr_nodes] Number of nodes to insert initially.");
570 printf(" [-A] Automatically resize hash table.");
571 printf("\n");
572 }
573
574 int main(int argc, char **argv)
575 {
576 int err;
577 pthread_t *tid_reader, *tid_writer;
578 void *tret;
579 unsigned long long *count_reader;
580 struct wr_count *count_writer;
581 unsigned long long tot_reads = 0, tot_writes = 0,
582 tot_add = 0, tot_add_exist = 0, tot_remove = 0;
583 unsigned long count, removed;
584 int i, a, ret;
585 struct sigaction act;
586 unsigned int remain;
587
588 if (argc < 4) {
589 show_usage(argc, argv);
590 return -1;
591 }
592
593 err = sscanf(argv[1], "%u", &nr_readers);
594 if (err != 1) {
595 show_usage(argc, argv);
596 return -1;
597 }
598
599 err = sscanf(argv[2], "%u", &nr_writers);
600 if (err != 1) {
601 show_usage(argc, argv);
602 return -1;
603 }
604
605 err = sscanf(argv[3], "%lu", &duration);
606 if (err != 1) {
607 show_usage(argc, argv);
608 return -1;
609 }
610
611 for (i = 4; i < argc; i++) {
612 if (argv[i][0] != '-')
613 continue;
614 switch (argv[i][1]) {
615 #ifdef DEBUG_YIELD
616 case 'r':
617 yield_active |= YIELD_READ;
618 break;
619 case 'w':
620 yield_active |= YIELD_WRITE;
621 break;
622 #endif
623 case 'a':
624 if (argc < i + 2) {
625 show_usage(argc, argv);
626 return -1;
627 }
628 a = atoi(argv[++i]);
629 cpu_affinities[next_aff++] = a;
630 use_affinity = 1;
631 printf_verbose("Adding CPU %d affinity\n", a);
632 break;
633 case 'c':
634 if (argc < i + 2) {
635 show_usage(argc, argv);
636 return -1;
637 }
638 rduration = atol(argv[++i]);
639 break;
640 case 'd':
641 if (argc < i + 2) {
642 show_usage(argc, argv);
643 return -1;
644 }
645 wdelay = atol(argv[++i]);
646 break;
647 case 'v':
648 verbose_mode = 1;
649 break;
650 case 'p':
651 if (argc < i + 2) {
652 show_usage(argc, argv);
653 return -1;
654 }
655 rand_pool = atol(argv[++i]);
656 break;
657 case 'h':
658 if (argc < i + 2) {
659 show_usage(argc, argv);
660 return -1;
661 }
662 init_hash_size = atol(argv[++i]);
663 break;
664 case 'u':
665 add_unique = 1;
666 break;
667 case 'i':
668 add_only = 1;
669 break;
670 case 'k':
671 init_populate = atol(argv[++i]);
672 break;
673 case 'A':
674 opt_auto_resize = 1;
675 break;
676 }
677 }
678
679 /* Check if hash size is power of 2 */
680 if (init_hash_size && init_hash_size & (init_hash_size - 1)) {
681 printf("Error: Hash table size %lu is not a power of 2.\n",
682 init_hash_size);
683 return -1;
684 }
685
686 memset(&act, 0, sizeof(act));
687 ret = sigemptyset(&act.sa_mask);
688 if (ret == -1) {
689 perror("sigemptyset");
690 return -1;
691 }
692 act.sa_handler = sigusr1_handler;
693 act.sa_flags = SA_RESTART;
694 ret = sigaction(SIGUSR1, &act, NULL);
695 if (ret == -1) {
696 perror("sigaction");
697 return -1;
698 }
699
700 printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
701 duration, nr_readers, nr_writers);
702 printf_verbose("Writer delay : %lu loops.\n", wdelay);
703 printf_verbose("Reader duration : %lu loops.\n", rduration);
704 printf_verbose("Random pool size : %lu.\n", rand_pool);
705 printf_verbose("Mode:%s%s.\n",
706 add_only ? " add only" : " add/remove",
707 add_unique ? " uniquify" : "");
708 printf_verbose("Initial hash table size: %lu buckets.\n", init_hash_size);
709 printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
710 "main", pthread_self(), (unsigned long)gettid());
711
712 tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
713 tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
714 count_reader = malloc(sizeof(*count_reader) * nr_readers);
715 count_writer = malloc(sizeof(*count_writer) * nr_writers);
716 test_ht = cds_lfht_new(test_hash, test_compare, 0x42UL,
717 init_hash_size,
718 opt_auto_resize ? CDS_LFHT_AUTO_RESIZE : 0,
719 call_rcu, synchronize_rcu, rcu_read_lock,
720 rcu_read_unlock);
721 ret = populate_hash();
722 assert(!ret);
723 err = create_all_cpu_call_rcu_data(0);
724 assert(!err);
725
726 next_aff = 0;
727
728 for (i = 0; i < nr_readers; i++) {
729 err = pthread_create(&tid_reader[i], NULL, thr_reader,
730 &count_reader[i]);
731 if (err != 0)
732 exit(1);
733 }
734 for (i = 0; i < nr_writers; i++) {
735 err = pthread_create(&tid_writer[i], NULL, thr_writer,
736 &count_writer[i]);
737 if (err != 0)
738 exit(1);
739 }
740
741 cmm_smp_mb();
742
743 test_go = 1;
744
745 remain = duration;
746 do {
747 remain = sleep(remain);
748 } while (remain > 0);
749
750 test_stop = 1;
751
752 for (i = 0; i < nr_readers; i++) {
753 err = pthread_join(tid_reader[i], &tret);
754 if (err != 0)
755 exit(1);
756 tot_reads += count_reader[i];
757 }
758 for (i = 0; i < nr_writers; i++) {
759 err = pthread_join(tid_writer[i], &tret);
760 if (err != 0)
761 exit(1);
762 tot_writes += count_writer[i].update_ops;
763 tot_add += count_writer[i].add;
764 tot_add_exist += count_writer[i].add_exist;
765 tot_remove += count_writer[i].remove;
766 }
767 printf("Counting nodes... ");
768 fflush(stdout);
769 cds_lfht_count_nodes(test_ht, &count, &removed);
770 printf("done.\n");
771 if (count || removed)
772 printf("WARNING: nodes left in the hash table upon destroy: "
773 "%lu nodes + %lu logically removed.\n", count, removed);
774 ret = cds_lfht_destroy(test_ht);
775
776 if (ret)
777 printf_verbose("final delete aborted\n");
778 else
779 printf_verbose("final delete success\n");
780 printf_verbose("total number of reads : %llu, writes %llu\n", tot_reads,
781 tot_writes);
782 printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
783 "nr_writers %3u "
784 "wdelay %6lu rand_pool %12llu nr_reads %12llu nr_writes %12llu nr_ops %12llu "
785 "nr_add %12llu nr_add_fail %12llu nr_remove %12llu nr_leaked %12lld\n",
786 argv[0], duration, nr_readers, rduration,
787 nr_writers, wdelay, rand_pool, tot_reads, tot_writes,
788 tot_reads + tot_writes, tot_add, tot_add_exist, tot_remove,
789 (long long) tot_add + init_populate - tot_remove - count);
790 free_all_cpu_call_rcu_data();
791 free(tid_reader);
792 free(tid_writer);
793 free(count_reader);
794 free(count_writer);
795 return 0;
796 }
This page took 0.042758 seconds and 3 git commands to generate.