An apparatus for relocating data amongst memory modules in a virtualized environment maintained by a hypervisor, the hypervisor administering access to memory by a partition with a Cache Page Table (‘CPT’) and a Physical Page Table (‘PPT’), the CPT comprising virtual to physical address mappings, the CPT accessible by an operating system executing in a partition of the virtualized environment, the PPT comprising virtual to physical address mappings, the PPT accessible by a computer processor, the apparatus comprising the computer processor, computer memory operatively coupled to the computer processor, the computer memory having disposed within it computer program instructions that, when executed by the computer processor, cause the apparatus to carry out the steps of:
- converting the virtual to physical address mappings of the CPT to virtual to logical address mappings;
- establishing a Logical Memory Block (‘LMB’) relocation tracker, the LMB relocation tracker comprising logical addresses of an LMB to be relocated, source physical addresses of the LMB to be relocated, target physical addresses of the LMB to be relocated, a translation block indicator for each relocation granule of the LMB, and a pin count associated with each relocation granule, the pin count representing a number of outstanding translations to the associated relocation granule;
- establishing a PPT entry tracker including PPT entries corresponding to the LMB to be relocated;
- relocating the LMB in a number of relocation granules in dependence upon the PPT entry tracker and the LMB relocation tracker including blocking translations to the relocation granules during relocation;
- and
- upon relocation of all granules in the LMB, removing, from the LMB relocation tracker, the logical addresses of the LMB to be relocated.