qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] virtio-mem: block size and address-assignment optimizations
@ 2020-09-28 11:49 David Hildenbrand
  2020-09-28 11:49 ` [PATCH v2 1/5] virtio-mem: Probe THP size to determine default block size David Hildenbrand
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: David Hildenbrand @ 2020-09-28 11:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Pankaj Gupta, Michael S. Tsirkin, David Hildenbrand,
	Dr. David Alan Gilbert, Wei Yang, Igor Mammedov

Let's try to detect the actual THP size and use it as default block size
(unless the page size of the backend indicates that THP don't apply).
Always allow to set a block size of 1 MiB, but warn if the configured block
size is smaller than the default. Handle large block sizes better, avoiding
a virtio-spec violation and optimizing address auto-detection.

For existing setups (x86-64), the default block size won't change (was, and
will be 2 MiB on anonymous memory). For existing x86-64 setups, the address
auto-detection won't change in relevant setups (esp., anonymous memory
and hugetlbfs with 2 MiB pages and no manual configuration of the block
size). I don't see the need for compatibility handling (especially, as
virtio-mem is still not considered production-ready).

Most of this is a preparation for future architectures, using hugetlbfs
to full extend, and using manually configured, larger block sizes
(relevant for vfio in the future).

v1 -> v2:
- Tweak some patch descriptions
- "virtio-mem: Probe THP size to determine default block size"
-- Beautify THP detection a bit.
-- Assume THP might only get used if the memory backend page size corresponds
   to the real hostpage size.
-- Use virtio_mem_default_block_size(RAMBlock *rb) to handle selection
   of the default block size for a RAMBlock.
-- Implement virtio_mem_get_block_size() as preparation for patch #5
- "memory-device: Add get_min_alignment() callback"
-- Simplify documentation.
- "virito-mem: Implement get_min_alignment()"
-- Simplify due to changes in patch #1.

David Hildenbrand (5):
  virtio-mem: Probe THP size to determine default block size
  virtio-mem: Check that "memaddr" is multiples of the block size
  memory-device: Support big alignment requirements
  memory-device: Add get_min_alignment() callback
  virito-mem: Implement get_min_alignment()

 hw/mem/memory-device.c         |  20 ++++--
 hw/virtio/virtio-mem-pci.c     |   7 +++
 hw/virtio/virtio-mem.c         | 110 +++++++++++++++++++++++++++++++--
 include/hw/mem/memory-device.h |  10 +++
 4 files changed, 137 insertions(+), 10 deletions(-)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-09-29 14:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-28 11:49 [PATCH v2 0/5] virtio-mem: block size and address-assignment optimizations David Hildenbrand
2020-09-28 11:49 ` [PATCH v2 1/5] virtio-mem: Probe THP size to determine default block size David Hildenbrand
2020-09-29 13:54   ` Pankaj Gupta
2020-09-29 14:02     ` David Hildenbrand
2020-09-29 14:24       ` Pankaj Gupta
2020-09-28 11:49 ` [PATCH v2 2/5] virtio-mem: Check that "memaddr" is multiples of the " David Hildenbrand
2020-09-28 11:49 ` [PATCH v2 3/5] memory-device: Support big alignment requirements David Hildenbrand
2020-09-28 11:49 ` [PATCH v2 4/5] memory-device: Add get_min_alignment() callback David Hildenbrand
2020-09-28 11:49 ` [PATCH v2 5/5] virito-mem: Implement get_min_alignment() David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).