[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v4 PATCH 39/49] multi-process: prevent duplicate memory initializat
From: |
Jagannathan Raman |
Subject: |
[RFC v4 PATCH 39/49] multi-process: prevent duplicate memory initialization in remote |
Date: |
Thu, 24 Oct 2019 05:09:20 -0400 |
When multiple controllers are configured in a remote process,
it's better for the memory to be managed by only one of the proxy
objects for that process, in order to conserve file descriptors. Added
"mem_int" flag for this purpose.
Signed-off-by: Elena Ufimtseva <address@hidden>
Signed-off-by: John G Johnson <address@hidden>
Signed-off-by: Jagannathan Raman <address@hidden>
---
New patch in v3
hw/proxy/qemu-proxy.c | 13 ++++++++++++-
include/hw/proxy/qemu-proxy.h | 1 +
qdev-monitor.c | 2 +-
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/hw/proxy/qemu-proxy.c b/hw/proxy/qemu-proxy.c
index 5aada67..623a6c5 100644
--- a/hw/proxy/qemu-proxy.c
+++ b/hw/proxy/qemu-proxy.c
@@ -350,6 +350,13 @@ static void pci_proxy_write_config(PCIDevice *d, uint32_t
addr, uint32_t val,
config_op_send(PCI_PROXY_DEV(d), addr, &val, l, CONF_WRITE);
}
+static void pci_proxy_dev_inst_init(Object *obj)
+{
+ PCIProxyDev *dev = PCI_PROXY_DEV(obj);
+
+ dev->mem_init = false;
+}
+
static void pci_proxy_dev_class_init(ObjectClass *klass, void *data)
{
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
@@ -364,6 +371,7 @@ static const TypeInfo pci_proxy_dev_type_info = {
.name = TYPE_PCI_PROXY_DEV,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCIProxyDev),
+ .instance_init = pci_proxy_dev_inst_init,
.abstract = true,
.class_size = sizeof(PCIProxyDevClass),
.class_init = pci_proxy_dev_class_init,
@@ -460,7 +468,10 @@ static void init_proxy(PCIDevice *dev, char *command, bool
need_spawn, Error **e
mpqemu_init_channel(pdev->mpqemu_link, &pdev->mpqemu_link->mmio,
pdev->mmio_sock);
- configure_memory_sync(pdev->sync, pdev->mpqemu_link);
+ if (!pdev->mem_init) {
+ pdev->mem_init = true;
+ configure_memory_sync(pdev->sync, pdev->mpqemu_link);
+ }
}
static void pci_proxy_dev_realize(PCIDevice *device, Error **errp)
diff --git a/include/hw/proxy/qemu-proxy.h b/include/hw/proxy/qemu-proxy.h
index 672303c..17e07ac 100644
--- a/include/hw/proxy/qemu-proxy.h
+++ b/include/hw/proxy/qemu-proxy.h
@@ -63,6 +63,7 @@ struct PCIProxyDev {
MPQemuLinkState *mpqemu_link;
RemoteMemSync *sync;
+ bool mem_init;
struct kvm_irqfd irqfd;
EventNotifier intr;
diff --git a/qdev-monitor.c b/qdev-monitor.c
index f38849e..2a2c10b 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -713,10 +713,10 @@ DeviceState *qdev_proxy_add(const char *rid, const char
*id, char *bus,
pdev->socket = old_pdev->socket;
pdev->mmio_sock = old_pdev->mmio_sock;
pdev->remote_pid = old_pdev->remote_pid;
+ pdev->mem_init = true;
} else {
pdev->rsocket = managed ? rsocket : -1;
pdev->socket = managed ? rsocket : -1;
-
}
pdev->managed = managed;
--
1.8.3.1
- [RFC v4 PATCH 27/49] multi-process: add remote option, (continued)
- [RFC v4 PATCH 27/49] multi-process: add remote option, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 28/49] multi-process: add remote options parser, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 30/49] multi-process: send heartbeat messages to remote, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 31/49] multi-process: handle heartbeat messages in remote process, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 32/49] multi-process: Use separate MMIO communication channel, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 34/49] multi-process/mon: choose HMP commands based on target, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 35/49] multi-process/mon: stub functions to enable QMP module for remote process, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 36/49] multi-process/mon: enable QMP module support in the remote process, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 38/49] multi-process/mon: Initialize QMP module for remote processes, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 37/49] multi-process/mon: Refactor monitor/chardev functions out of vl.c, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 39/49] multi-process: prevent duplicate memory initialization in remote,
Jagannathan Raman <=
- [RFC v4 PATCH 40/49] multi-process/mig: build migration module in the remote process, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 41/49] multi-process/mig: Enable VMSD save in the Proxy object, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 42/49] multi-process/mig: Send VMSD of remote to the Proxy object, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 44/49] multi-process/mig: refactor runstate_check into common file, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 45/49] multi-process/mig: Synchronize runstate of remote process, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 47/49] multi-process: Enable support for multiple devices in remote, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 08/49] multi-process: add functions to synchronize proxy and remote endpoints, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 07/49] multi-process: define mpqemu-link object, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 49/49] multi-process: add configure and usage information, Jagannathan Raman, 2019/10/24
- [RFC v4 PATCH 48/49] multi-process: add the concept description to docs/devel/qemu-multiprocess, Jagannathan Raman, 2019/10/24