As mentioned previously, each domain has a maximum and current
memory allocation. The maximum allocation, set at domain creation
time, cannot be modified. However a domain can choose to reduce
and subsequently grow its current allocation by using the
following call:
memory_op(unsigned int op, void *arg)
Increase or decrease current memory allocation (as determined by
the value of op). The available operations are:
- XENMEM_increase_reservation
- Request an increase in machine
memory allocation; arg must point to a xen_memory_reservation structure.
- XENMEM_decrease_reservation
- Request a decrease in machine
memory allocation; arg must point to a xen_memory_reservation structure.
- XENMEM_maximum_ram_page
- Request the frame number of the
highest-addressed frame of machine memory in the system. arg
must point to an unsigned long where this value will be
stored.
- XENMEM_current_reservation
- Returns current memory reservation
of the specified domain.
- XENMEM_maximum_reservation
- Returns maximum memory resrevation
of the specified domain.
In addition to simply reducing or increasing the current memory
allocation via a `balloon driver', this call is also useful for
obtaining contiguous regions of machine memory when required (e.g.
for certain PCI devices, or if using superpages).