Memory ordering and usage of ASM cmpxchg() instead of compiler atomic intrinsics
Change-Id: I4dadebc32721744dad982f3fc5b3eea7ab7ca745
This commit is contained in:
committed by
Masamichi Takagi
parent
7aa2d64294
commit
c3c57940ba
@@ -587,8 +587,7 @@ static int fileobj_get_page(struct memobj *memobj, off_t off,
|
||||
|
||||
/* Update the array but see if someone did it already and use
|
||||
* that if so */
|
||||
if (!__sync_bool_compare_and_swap(&memobj->pages[page_ind],
|
||||
NULL, virt)) {
|
||||
if (cmpxchg(&memobj->pages[page_ind], NULL, virt) != NULL) {
|
||||
ihk_mc_free_pages_user(virt, 1);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user