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