def test_deallocation_1_page(self): vm_hugepagesz = 1048576 vm_hugepages = 4 self.assertEqual( hugepages.calculate_required_deallocation(vm_hugepages, vm_hugepagesz), 1)
def test_deallocation_1_page(self): vm_hugepagesz = 1048576 vm_hugepages = 4 self.assertEqual(hugepages.calculate_required_deallocation( vm_hugepages, vm_hugepagesz), 1 )
def test_pure_dynamic_hugepages(self): vm_hugepagesz = 1048576 vm_hugepages = 4 # Fully dynamic deallocation (= deallocate the size of the VM) self.assertEqual( hugepages.calculate_required_deallocation(vm_hugepages, vm_hugepagesz), 4)
def test_pure_dynamic_hugepages(self): vm_hugepagesz = 1048576 vm_hugepages = 4 # Fully dynamic deallocation (= deallocate the size of the VM) self.assertEqual(hugepages.calculate_required_deallocation( vm_hugepages, vm_hugepagesz), 4 )
def test_deallocation_4_pages(self): vm_hugepagesz = 1048576 vm_hugepages = 4 # The VM was solely in the dynamic allocation space (16 preallocated, # 12 reserved but 20 total), we can fully deallocate it. self.assertEqual( hugepages.calculate_required_deallocation(vm_hugepages, vm_hugepagesz), 4)
def test_deallocation_4_pages(self): vm_hugepagesz = 1048576 vm_hugepages = 4 # The VM was solely in the dynamic allocation space (16 preallocated, # 12 reserved but 20 total), we can fully deallocate it. self.assertEqual(hugepages.calculate_required_deallocation( vm_hugepages, vm_hugepagesz), 4 )
def test_deallocation_4_pages_no_cmdline(self): vm_hugepagesz = 1048576 vm_hugepages = 4 # There are 17 pages in the system, none of which were allocated on # boot. # - the VM consumed 4 pages, no other consumption # - there are 12 pages reserved # - that means we could deallocate up to 5 pages, but we don't touch # pages out of VM's domain - therefore deallocating only 4 pages self.assertEqual( hugepages.calculate_required_deallocation(vm_hugepages, vm_hugepagesz), 4)
def test_deallocation_4_pages_no_cmdline(self): vm_hugepagesz = 1048576 vm_hugepages = 4 # There are 17 pages in the system, none of which were allocated on # boot. # - the VM consumed 4 pages, no other consumption # - there are 12 pages reserved # - that means we could deallocate up to 5 pages, but we don't touch # pages out of VM's domain - therefore deallocating only 4 pages self.assertEqual(hugepages.calculate_required_deallocation( vm_hugepages, vm_hugepagesz), 4 )