From a40fe8311f0d62fc64ce63bb87637b941367d55d Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Tue, 9 Dec 2014 19:50:08 -0700 Subject: [PATCH] opal_lifo: add missing memory barriers in 128-bit atomic functions --- opal/class/opal_lifo.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opal/class/opal_lifo.h b/opal/class/opal_lifo.h index 0c5b230b15..fa7218c8c5 100644 --- a/opal/class/opal_lifo.h +++ b/opal/class/opal_lifo.h @@ -122,6 +122,7 @@ static inline opal_list_item_t *opal_lifo_push_atomic (opal_lifo_t *lifo, /* to protect against ABA issues it is sufficient to only update the counter in pop */ if (opal_atomic_cmpset_ptr (&lifo->opal_lifo_head.data.item, next, item)) { + opal_atomic_wmb (); return next; } /* DO some kind of pause to release the bus */ @@ -147,6 +148,7 @@ static inline opal_list_item_t *opal_lifo_pop_atomic (opal_lifo_t* lifo) if (opal_update_counted_pointer (&lifo->opal_lifo_head, old_head, (opal_list_item_t *) item->opal_list_next)) { + opal_atomic_wmb (); item->opal_list_next = NULL; return item; }