Skip to content

movealloc

include/mem/movealloc.h View source View on GitHub

Implements movealloc.

this feature allows us to take a given virtual pointer, and copy its pages over to pages in the correct domain, and change the page tables to point to these correct pages. this is a form of “mini page migration” that we use to move over initial allocations to the right node. this lives entirely separate from our real page migration

struct movealloc_callback_node (3 fields) source
§ void *a
§ struct list_node list
struct movealloc_callback_chain (1 field) source
§ struct list_head list
typedef void (*movealloc_callback)(void * a, void * b)
source
void movealloc_full(
    domain_id_t domain,
    void *ptr,
    struct vmm_request rq
)
source

this will always panic upon alloc failure - only to be used in init code!

void movealloc_exec_all(void)
source
#define movealloc(d, p, ...)
source
Expansion
#define movealloc(d, p, ...) \
    movealloc_full((d), (p), vmm_request_with_defaults(__VA_ARGS__))
#define movealloc_callback_node_from_list_node(ln)
source
#define MOVEALLOC_REGISTER_CALL(name, callback, param1, param2)
source
Expansion
#define MOVEALLOC_REGISTER_CALL(name, callback, param1, param2) \
    static LINKER_SECTION_OBJECT(struct movealloc_callback_node, \
                                 movealloc_callbacks) \
        movealloc_##name = {callback, param1, param2, .list = {0}};