X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=src%2Furcu-bp.c;h=675b5d6e8aea929e8b8a7a1e757c777292a89b4f;hp=81bb91a9f07ebbcea661dd159bc726851ae2f041;hb=6fd172f599e8d798e68974a786dd930d876f182e;hpb=d8d9a3405ce46af6d34d2e80e260ad50f3d211a0 diff --git a/src/urcu-bp.c b/src/urcu-bp.c index 81bb91a..675b5d6 100644 --- a/src/urcu-bp.c +++ b/src/urcu-bp.c @@ -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, ®istry_arena.chunk_list, node) { - munmap(chunk, chunk->data_len + munmap((void *) chunk, chunk->data_len + sizeof(struct registry_chunk)); } CDS_INIT_LIST_HEAD(®istry_arena.chunk_list);