Use initial-exec tls model
[urcu.git] / src / urcu-bp.c
index 81bb91a9f07ebbcea661dd159bc726851ae2f041..675b5d6e8aea929e8b8a7a1e757c777292a89b4f 100644 (file)
@@ -142,7 +142,7 @@ struct rcu_gp rcu_gp = { .ctr = RCU_GP_COUNT };
  * Pointer to registry elements. Written to only by each individual reader. Read
  * by both the reader and the writers.
  */
-DEFINE_URCU_TLS(struct rcu_reader *, rcu_reader);
+DEFINE_URCU_TLS_IE(struct rcu_reader *, rcu_reader);
 
 static CDS_LIST_HEAD(registry);
 
@@ -374,7 +374,8 @@ void expand_arena(struct registry_arena *arena)
                        sizeof(struct registry_chunk)
                        + sizeof(struct rcu_reader));
                new_chunk_len = ARENA_INIT_ALLOC;
-               new_chunk = mmap(NULL, new_chunk_len,
+               new_chunk = (struct registry_chunk *) mmap(NULL,
+                       new_chunk_len,
                        PROT_READ | PROT_WRITE,
                        MAP_ANONYMOUS | MAP_PRIVATE,
                        -1, 0);
@@ -408,7 +409,8 @@ void expand_arena(struct registry_arena *arena)
        }
 
        /* Remap did not succeed, we need to add a new chunk. */
-       new_chunk = mmap(NULL, new_chunk_len,
+       new_chunk = (struct registry_chunk *) mmap(NULL,
+               new_chunk_len,
                PROT_READ | PROT_WRITE,
                MAP_ANONYMOUS | MAP_PRIVATE,
                -1, 0);
@@ -591,8 +593,13 @@ void rcu_sys_membarrier_status(int available)
 static
 void rcu_sys_membarrier_status(int available)
 {
-       if (available)
-               urcu_bp_has_sys_membarrier = 1;
+       /*
+        * membarrier has blocking behavior, which changes the
+        * application behavior too much compared to using barriers when
+        * synchronize_rcu is used repeatedly (without using call_rcu).
+        * Don't use membarrier for now, unless its use has been
+        * explicitly forced when building liburcu.
+        */
 }
 #endif
 
@@ -625,7 +632,7 @@ void rcu_bp_exit(void)
 
                cds_list_for_each_entry_safe(chunk, tmp,
                                &registry_arena.chunk_list, node) {
-                       munmap(chunk, chunk->data_len
+                       munmap((void *) chunk, chunk->data_len
                                        + sizeof(struct registry_chunk));
                }
                CDS_INIT_LIST_HEAD(&registry_arena.chunk_list);
This page took 0.022955 seconds and 4 git commands to generate.