sandbox: vm: add synchronisation using spinlocks

This commit is contained in:
2023-02-02 21:14:02 +00:00
parent d4449b8d87
commit 4237b6ca20
3 changed files with 28 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
#include <socks/types.h>
#include <socks/status.h>
#include <socks/queue.h>
#include <socks/locks.h>
/* maximum number of NUMA nodes */
#define VM_MAX_NODES 64
@@ -106,6 +107,7 @@ typedef struct vm_zone_descriptor {
typedef struct vm_zone {
vm_zone_descriptor_t z_info;
spin_lock_t z_lock;
queue_t z_free_pages[VM_MAX_PAGE_ORDERS];
unsigned long z_size;
@@ -130,6 +132,8 @@ typedef struct vm_cache {
queue_t c_slabs_partial;
queue_t c_slabs_empty;
spin_lock_t c_lock;
/* number of objects that can be stored in a single slab */
unsigned int c_obj_count;
/* the size of object kept in the cache */