#include <vppinfra/heap.h>
#include <vppinfra/pool.h>
#include <vppinfra/format.h>
+#include <vppinfra/lock.h>
#ifndef MMAP_PAGESIZE
#define MMAP_PAGESIZE (clib_mem_get_page_size())
typedef struct
{
ssvm_shared_header_t *sh;
- u64 ssvm_size;
+ uword ssvm_size;
+ uword requested_va;
u32 my_pid;
u8 *name;
- uword requested_va;
+ u8 numa; /**< Numa requested at alloc time */
int i_am_master;
union
}
while (clib_atomic_test_and_set (&h->lock))
- ;
+ CLIB_PAUSE ();
h->owner_pid = my_pid;
h->recursion_count = 1;
ssvm_lock_non_recursive (ssvm_shared_header_t * h, u32 tag)
{
while (clib_atomic_test_and_set (&h->lock))
- ;
+ CLIB_PAUSE ();
h->tag = tag;
}
{
h->owner_pid = 0;
h->tag = 0;
- CLIB_MEMORY_BARRIER ();
- h->lock = 0;
+ clib_atomic_release (&h->lock);
}
}
ssvm_unlock_non_recursive (ssvm_shared_header_t * h)
{
h->tag = 0;
- CLIB_MEMORY_BARRIER ();
- h->lock = 0;
+ clib_atomic_release (&h->lock);
}
static inline void *