Lines Matching defs:size
39 "Big Block size in bytes. Default is 0 (auto-detection).");
45 * size of a Sub Block (SB) is determined based on the device block size, the
46 * pageblock size, and the maximum allocation granularity of the buddy.
53 * The mode is determined automatically based on the Linux memory block size
54 * and the device block size.
121 /* The current size of the device. */
123 /* The requested size of the device. */
126 /* The device block size (for communicating with the device). */
132 /* Maximum region size in bytes. */
166 /* The subblock size. */
217 /* The block size used for plugging/adding/removing. */
613 static bool virtio_mem_could_add_memory(struct virtio_mem *vm, uint64_t size)
615 if (WARN_ON_ONCE(size > vm->offline_threshold))
618 return atomic64_read(&vm->offline_size) + size <= vm->offline_threshold;
630 uint64_t size)
646 addr + size - 1);
648 atomic64_add(size, &vm->offline_size);
649 rc = add_memory_driver_managed(vm->mgid, addr, size, vm->resource_name,
652 atomic64_sub(size, &vm->offline_size);
668 const uint64_t size = memory_block_size_bytes();
670 return virtio_mem_add_memory(vm, addr, size);
679 const uint64_t size = vm->bbm.bb_size;
681 return virtio_mem_add_memory(vm, addr, size);
694 uint64_t size)
699 addr + size - 1);
700 rc = remove_memory(addr, size);
702 atomic64_sub(size, &vm->offline_size);
720 const uint64_t size = memory_block_size_bytes();
722 return virtio_mem_remove_memory(vm, addr, size);
735 uint64_t size)
741 addr + size - 1);
743 rc = offline_and_remove_memory(addr, size);
745 atomic64_sub(size, &vm->offline_size);
770 const uint64_t size = memory_block_size_bytes();
772 return virtio_mem_offline_and_remove_memory(vm, addr, size);
811 const uint64_t size = vm->bbm.bb_size;
813 return virtio_mem_offline_and_remove_memory(vm, addr, size);
845 uint64_t size)
847 return start < vm->addr + vm->region_size && vm->addr < start + size;
855 uint64_t size)
857 return start >= vm->addr && start + size <= vm->addr + vm->region_size;
990 const unsigned long size = PFN_PHYS(mhp->nr_pages);
994 if (!virtio_mem_overlaps_range(vm, start, size))
1004 if (WARN_ON_ONCE(size != memory_block_size_bytes() ||
1015 if (WARN_ON_ONCE(id != virtio_mem_phys_to_bb_id(vm, start + size - 1)))
1058 atomic64_add(size, &vm->offline_size);
1073 atomic64_sub(size, &vm->offline_size);
1284 * size is smaller than that and we have a mixture of plugged and
1307 * will be at least the size of a pageblock.
1395 uint64_t size)
1397 const uint64_t nb_vm_blocks = size / vm->device_block_size;
1409 addr + size - 1);
1413 vm->plugged_size += size;
1433 uint64_t size)
1435 const uint64_t nb_vm_blocks = size / vm->device_block_size;
1447 addr + size - 1);
1451 vm->plugged_size -= size;
1503 const uint64_t size = count * vm->sbm.sb_size;
1506 rc = virtio_mem_send_plug_request(vm, addr, size);
1521 const uint64_t size = count * vm->sbm.sb_size;
1524 rc = virtio_mem_send_unplug_request(vm, addr, size);
1538 const uint64_t size = vm->bbm.bb_size;
1540 return virtio_mem_send_unplug_request(vm, addr, size);
1551 const uint64_t size = vm->bbm.bb_size;
1553 return virtio_mem_send_plug_request(vm, addr, size);
2379 /* see if there is a request to change the size */
2383 dev_info(&vm->vdev->dev, "plugged size: 0x%llx", vm->plugged_size);
2384 dev_info(&vm->vdev->dev, "requested size: 0x%llx", vm->requested_size);
2579 dev_info(&vm->vdev->dev, "memory block size: 0x%lx",
2582 dev_info(&vm->vdev->dev, "subblock size: 0x%llx",
2585 dev_info(&vm->vdev->dev, "big block size: 0x%llx",
2634 uint64_t size)
2636 const uint64_t nb_vm_blocks = size / vm->device_block_size;
2645 addr + size - 1);
2738 dev_info(&vm->vdev->dev, "region size: 0x%llx", vm->region_size);
2739 dev_info(&vm->vdev->dev, "device block size: 0x%llx",