Unverified Commit ac7484c5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5566 tracing: Ensure visibility when inserting an element into tracing_map

parents 6382a96e 53a1d41a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -574,7 +574,12 @@ __tracing_map_insert(struct tracing_map *map, void *key, bool lookup_only)
				}

				memcpy(elt->key, key, map->key_size);
				entry->val = elt;
				/*
				 * Ensure the initialization is visible and
				 * publish the elt.
				 */
				smp_wmb();
				WRITE_ONCE(entry->val, elt);
				atomic64_inc(&map->hits);

				return entry->val;