[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 05/15] vhost: Don't merge unmergeable memory sections
From: |
David Hildenbrand |
Subject: |
[PATCH RFC 05/15] vhost: Don't merge unmergeable memory sections |
Date: |
Wed, 13 Oct 2021 12:33:20 +0200 |
Memory sections that are marked unmergeable should not be merged, to
allow for atomic removal later.
Signed-off-by: David Hildenbrand <david@redhat.com>
---
hw/virtio/vhost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 2707972870..49a1074097 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -620,7 +620,7 @@ static void vhost_region_add_section(struct vhost_dev *dev,
mrs_size, mrs_host);
}
- if (dev->n_tmp_sections) {
+ if (dev->n_tmp_sections && !section->unmergeable) {
/* Since we already have at least one section, lets see if
* this extends it; since we're scanning in order, we only
* have to look at the last one, and the FlatView that calls
@@ -653,7 +653,7 @@ static void vhost_region_add_section(struct vhost_dev *dev,
size_t offset = mrs_gpa - prev_gpa_start;
if (prev_host_start + offset == mrs_host &&
- section->mr == prev_sec->mr &&
+ section->mr == prev_sec->mr && !prev_sec->unmergeable &&
(!dev->vhost_ops->vhost_backend_can_merge ||
dev->vhost_ops->vhost_backend_can_merge(dev,
mrs_host, mrs_size,
--
2.31.1
- [PATCH RFC 00/15] virtio-mem: Expose device memory via separate memslots, David Hildenbrand, 2021/10/13
- [PATCH RFC 01/15] memory: Drop mapping check from memory_region_get_ram_discard_manager(), David Hildenbrand, 2021/10/13
- [PATCH RFC 02/15] kvm: Return number of free memslots, David Hildenbrand, 2021/10/13
- [PATCH RFC 03/15] vhost: Return number of free memslots, David Hildenbrand, 2021/10/13
- [PATCH RFC 04/15] memory: Allow for marking memory region aliases unmergeable, David Hildenbrand, 2021/10/13
- [PATCH RFC 05/15] vhost: Don't merge unmergeable memory sections,
David Hildenbrand <=
- [PATCH RFC 06/15] memory-device: Move memory_device_check_addable() directly into memory_device_pre_plug(), David Hildenbrand, 2021/10/13
- [PATCH RFC 07/15] memory-device: Generalize memory_device_used_region_size(), David Hildenbrand, 2021/10/13
- [PATCH RFC 08/15] memory-device: Support memory devices that consume a variable number of memslots, David Hildenbrand, 2021/10/13
- [PATCH RFC 09/15] vhost: Respect reserved memslots for memory devices when realizing a vhost device, David Hildenbrand, 2021/10/13
- [PATCH RFC 10/15] virtio-mem: Set the RamDiscardManager for the RAM memory region earlier, David Hildenbrand, 2021/10/13
- [PATCH RFC 11/15] virtio-mem: Fix typo in virito_mem_intersect_memory_section() function name, David Hildenbrand, 2021/10/13
- [PATCH RFC 12/15] virtio-mem: Expose device memory via separate memslots, David Hildenbrand, 2021/10/13