[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4 15/18] xen/mem_sharing: VM forking



Hi Tamas,

On 08/01/2020 17:14, Tamas K Lengyel wrote:
+static int mem_sharing_fork(struct domain *d, struct domain *cd)
+{
+    int rc;
+
+    if ( !d->controller_pause_count &&
+         (rc = domain_pause_by_systemcontroller(d)) )

AFAIU, the parent domain will be paused if it wasn't paused before and this will not be unpaused by the same hypercall. Right?

If so, this brings two questions:
    - What would happen if the toolstack decide to unpause the domain?
- How does the caller knows whether this was paused by the hypercall or not?

I would also suggest to document the behavior of the hypercall as this is not entirely obvious that the domain will be paused here.

+        return rc;
+
+    cd->max_pages = d->max_pages;
+    cd->max_vcpus = d->max_vcpus;
+
+    /* this is preemptible so it's the first to get done */
+    if ( (rc = fork_hap_allocation(d, cd)) )
+        return rc;
+
+    if ( (rc = bring_up_vcpus(cd, d->cpupool)) )
+        return rc;
+
+    if ( (rc = hvm_copy_context_and_params(d, cd)) )
+        return rc;
+
+    fork_tsc(d, cd);
+
+    cd->parent = d;

How do you ensure that the parent domain will not get destroyed before the forked domain? Do you have a refcount somewhere?

+
+    return 0;
+}
+

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.