qemu-kvm/kvm-virtio-mem-default-enable-dynamic-memslots.patch
Miroslav Rezanina 6b2ce2692f * Mon Feb 12 2024 Miroslav Rezanina <mrezanin@redhat.com> - 8.2.0-5
- kvm-hv-balloon-use-get_min_alignment-to-express-32-GiB-a.patch [RHEL-20341]
- kvm-memory-device-reintroduce-memory-region-size-check.patch [RHEL-20341]
- kvm-block-backend-Allow-concurrent-context-changes.patch [RHEL-24593]
- kvm-scsi-Await-request-purging.patch [RHEL-24593]
- kvm-string-output-visitor-show-structs-as-omitted.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-string-output-visitor-Fix-pseudo-struct-handling.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-qdev-properties-alias-all-object-class-properties.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-qdev-add-IOThreadVirtQueueMappingList-property-type.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-virtio-blk-add-iothread-vq-mapping-parameter.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-virtio-blk-Fix-potential-nullpointer-read-access-in-.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-iotests-add-filter_qmp_generated_node_ids.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-iotests-port-141-to-Python-for-reliable-QMP-testing.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-monitor-only-run-coroutine-commands-in-qemu_aio_cont.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-virtio-blk-move-dataplane-code-into-virtio-blk.c.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-virtio-blk-rename-dataplane-create-destroy-functions.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-virtio-blk-rename-dataplane-to-ioeventfd.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-virtio-blk-restart-s-rq-reqs-in-vq-AioContexts.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-virtio-blk-tolerate-failure-to-set-BlockBackend-AioC.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-virtio-blk-always-set-ioeventfd-during-startup.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-tests-unit-Bump-test-replication-timeout-to-60-secon.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-iotests-iothreads-stream-Use-the-right-TimeoutError.patch [RHEL-17369 RHEL-20764 RHEL-7356]
- kvm-virtio-mem-default-enable-dynamic-memslots.patch [RHEL-24045]
- Resolves: RHEL-20341
  (memory-device size alignment check invalid in QEMU 8.2)
- Resolves: RHEL-24593
  (qemu crash blk_get_aio_context(BlockBackend *): Assertion `ctx == blk->ctx' when repeatedly hotplug/unplug disk)
- Resolves: RHEL-17369
  ([nfv virt][rt][post-copy migration] qemu-kvm: ../block/qcow2.c:5263: ImageInfoSpecific *qcow2_get_specific_info(BlockDriverState *, Error **): Assertion `false' failed.)
- Resolves: RHEL-20764
  ([qemu-kvm] Enable qemu multiqueue block layer support)
- Resolves: RHEL-7356
  ([qemu-kvm] no response with QMP command device_add when repeatedly hotplug/unplug virtio disks [RHEL-9])
- Resolves: RHEL-24045
  (QEMU: default-enable dynamically using multiple memslots for virtio-mem)
2024-02-12 01:37:48 -05:00

71 lines
2.7 KiB
Diff

From 94bccae527f1ab8328cc7692532046d700e2ca71 Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Mon, 5 Feb 2024 19:27:07 +0100
Subject: [PATCH 22/22] virtio-mem: default-enable "dynamic-memslots"
RH-Author: David Hildenbrand <david@redhat.com>
RH-MergeRequest: 220: virtio-mem: default-enable "dynamic-memslots"
RH-Jira: RHEL-24045
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Commit: [1/1] d9a60acd7de1d8703ea3ca938e388e19f31f5347
JIRA: https://issues.redhat.com/browse/RHEL-24045
Upstream: RHEL only
We only support selected vhost-user devices in combination with
virtio-mem in RHEL. One devices that works well is virtiofsd, devices that
are currently incompatible include DPDK and SPDK.
The vhost devices we support must be compatible with the dynamic-memslot
feature (i.e., support at least 509 memslots, support dynamically adding/
removing memslots), such that setting "dynamic-memslots=on" will work a
expected and not make certain QEMU commandlines or hotplug of vhost-user
devices bail out.
Let's set "dynamic-memslots=on" starting with RHEL 9.4, so we
get the benefits (i.e., reduced metadata consumption in KVM, majority of
unplugged memory being inaccessible) as default.
When wanting to run virtio-mem with incompatible vhost-user devices, it
might just work (if the vhost-user device is created before the
virtio-mem device), or the feature can be manually disabled by
specifying "dynamic-memslots=off".
Signed-off-by: David Hildenbrand <david@redhat.com>
---
hw/core/machine.c | 2 ++
hw/virtio/virtio-mem.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 446601ee30..309f6ba685 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -78,6 +78,8 @@ GlobalProperty hw_compat_rhel_9_4[] = {
{ "vfio-pci-nohotplug", "x-ramfb-migrate", "off" },
/* hw_compat_rhel_9_4 from hw_compat_8_1 */
{ "igb", "x-pcie-flr-init", "off" },
+ /* hw_compat_rhel_9_4 jira RHEL-24045 */
+ { "virtio-mem", "dynamic-memslots", "off" },
};
const size_t hw_compat_rhel_9_4_len = G_N_ELEMENTS(hw_compat_rhel_9_4);
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index 75ee38aa46..00ca91e8fe 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -1696,8 +1696,9 @@ static Property virtio_mem_properties[] = {
#endif
DEFINE_PROP_BOOL(VIRTIO_MEM_EARLY_MIGRATION_PROP, VirtIOMEM,
early_migration, true),
+ /* RHEL: default-enable "dynamic-memslots" (jira RHEL-24045) */
DEFINE_PROP_BOOL(VIRTIO_MEM_DYNAMIC_MEMSLOTS_PROP, VirtIOMEM,
- dynamic_memslots, false),
+ dynamic_memslots, true),
DEFINE_PROP_END_OF_LIST(),
};
--
2.39.3