All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V5 00/25] Live Update [restart] : fork mode?
@ 2021-07-30 13:10 Zheng Chuan
  2021-08-04  9:30 ` Zheng Chuan
  2021-08-04 20:50 ` Steven Sistare
  0 siblings, 2 replies; 4+ messages in thread
From: Zheng Chuan @ 2021-07-30 13:10 UTC (permalink / raw)
  To: Steve Sistare, Qemu Developers, Dr. David Alan Gilbert,
	Juan Quintela, Daniel P. Berrangé,
	Alex Williamson, Paolo Bonzini, Philippe Mathieu-Daudé,
	Xiexiangyou

Hi, Steve
I have saw the discussion about the fork+exec mode below:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg815956.html

And I am still very curious and I want to discuss about the possibility to support both fork+exec and exec in cpr framework.

1.Why
fork+exec could have some advantages and also drawbacks versus execvp() directly.
Advantages
i) fork+exec give the chance to fallback to original process even after we do exec which is important for workload seamless if any error happens.
ii) smaller downtime since we could remove the vm_start() downtime out of the frozen window.
Drawbacks
i)need more codes to handle including fork,address/ports conflict between parent and child.
ii)more complex life cycle management for the two processes.

2.How
The cpr framework is flexible and scalable, and maybe we can make use of most codes to support both execvp and fork+exec mode.
However, we may need to do more work compared to execvp method.
i) do fork mode in a thread like migration thread
ii) make parent and child talk to each other through socket or anonymous pipe
iii)make use of sharing mechanism of fds in cpr framework including memfd, vfio and devices fds
iv)deal with the conflict about the socket address and port like vnc (do by reuse port and pass the different args by cprexec)
v) do life cycle managements for two qemu processes and need parent exit and reconnection for the child at last by the management service

Please tell me if I am missing something important:)

-- 
Regards.
Chuan


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

* Re: [PATCH V5 00/25] Live Update [restart] : fork mode?
  2021-07-30 13:10 [PATCH V5 00/25] Live Update [restart] : fork mode? Zheng Chuan
@ 2021-08-04  9:30 ` Zheng Chuan
  2021-08-04 20:50 ` Steven Sistare
  1 sibling, 0 replies; 4+ messages in thread
From: Zheng Chuan @ 2021-08-04  9:30 UTC (permalink / raw)
  To: Steve Sistare, Qemu Developers, Dr. David Alan Gilbert,
	Juan Quintela, Daniel P. Berrangé,
	Alex Williamson, Paolo Bonzini, Philippe Mathieu-Daudé,
	Xiexiangyou

kindly ping?

On 2021/7/30 21:10, Zheng Chuan wrote:
> Hi, Steve
> I have saw the discussion about the fork+exec mode below:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg815956.html
> 
> And I am still very curious and I want to discuss about the possibility to support both fork+exec and exec in cpr framework.
> 
> 1.Why
> fork+exec could have some advantages and also drawbacks versus execvp() directly.
> Advantages
> i) fork+exec give the chance to fallback to original process even after we do exec which is important for workload seamless if any error happens.
> ii) smaller downtime since we could remove the vm_start() downtime out of the frozen window.
> Drawbacks
> i)need more codes to handle including fork,address/ports conflict between parent and child.
> ii)more complex life cycle management for the two processes.
> 
> 2.How
> The cpr framework is flexible and scalable, and maybe we can make use of most codes to support both execvp and fork+exec mode.
> However, we may need to do more work compared to execvp method.
> i) do fork mode in a thread like migration thread
> ii) make parent and child talk to each other through socket or anonymous pipe
> iii)make use of sharing mechanism of fds in cpr framework including memfd, vfio and devices fds
> iv)deal with the conflict about the socket address and port like vnc (do by reuse port and pass the different args by cprexec)
> v) do life cycle managements for two qemu processes and need parent exit and reconnection for the child at last by the management service
> 
> Please tell me if I am missing something important:)
> 

-- 
Regards.
Chuan


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

* Re: [PATCH V5 00/25] Live Update [restart] : fork mode?
  2021-07-30 13:10 [PATCH V5 00/25] Live Update [restart] : fork mode? Zheng Chuan
  2021-08-04  9:30 ` Zheng Chuan
@ 2021-08-04 20:50 ` Steven Sistare
  2021-08-05 14:04   ` Zheng Chuan
  1 sibling, 1 reply; 4+ messages in thread
From: Steven Sistare @ 2021-08-04 20:50 UTC (permalink / raw)
  To: Zheng Chuan, Qemu Developers, Dr. David Alan Gilbert,
	Juan Quintela, Daniel P. Berrangé,
	Alex Williamson, Paolo Bonzini, Philippe Mathieu-Daudé,
	Xiexiangyou

On 7/30/2021 9:10 AM, Zheng Chuan wrote:
> Hi, Steve
> I have saw the discussion about the fork+exec mode below:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg815956.html
> 
> And I am still very curious and I want to discuss about the possibility to support both fork+exec and exec in cpr framework.
> 
> 1.Why
> fork+exec could have some advantages and also drawbacks versus execvp() directly.
> Advantages
> i) fork+exec give the chance to fallback to original process even after we do exec which is important for workload seamless if any error happens.
> ii) smaller downtime since we could remove the vm_start() downtime out of the frozen window.
> Drawbacks
> i)need more codes to handle including fork,address/ports conflict between parent and child.
> ii)more complex life cycle management for the two processes.
> 
> 2.How
> The cpr framework is flexible and scalable, and maybe we can make use of most codes to support both execvp and fork+exec mode.
> However, we may need to do more work compared to execvp method.
> i) do fork mode in a thread like migration thread
> ii) make parent and child talk to each other through socket or anonymous pipe
> iii)make use of sharing mechanism of fds in cpr framework including memfd, vfio and devices fds
> iv)deal with the conflict about the socket address and port like vnc (do by reuse port and pass the different args by cprexec)
> v) do life cycle managements for two qemu processes and need parent exit and reconnection for the child at last by the management service
> 
> Please tell me if I am missing something important:)

Hi Zheng, that list sounds about right.  However, additional kernel changes would be needed to 
change ownership of the vfio device descriptors. The vfio module records the mm of the creating
process, and does not allow other processes to unmap ranges.  Also, the mm->locked_vm would 
need to be transferred to the new process.

Fork+exec could be a new mode to the cprsave command.

- Steve


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

* Re: [PATCH V5 00/25] Live Update [restart] : fork mode?
  2021-08-04 20:50 ` Steven Sistare
@ 2021-08-05 14:04   ` Zheng Chuan
  0 siblings, 0 replies; 4+ messages in thread
From: Zheng Chuan @ 2021-08-05 14:04 UTC (permalink / raw)
  To: Steven Sistare, Qemu Developers, Dr. David Alan Gilbert,
	Juan Quintela, Daniel P. Berrangé,
	Alex Williamson, Paolo Bonzini, Philippe Mathieu-Daudé,
	Xiexiangyou

Hi, Steve.

On 2021/8/5 4:50, Steven Sistare wrote:
> On 7/30/2021 9:10 AM, Zheng Chuan wrote:
>> Hi, Steve
>> I have saw the discussion about the fork+exec mode below:
>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg815956.html
>>
>> And I am still very curious and I want to discuss about the possibility to support both fork+exec and exec in cpr framework.
>>
>> 1.Why
>> fork+exec could have some advantages and also drawbacks versus execvp() directly.
>> Advantages
>> i) fork+exec give the chance to fallback to original process even after we do exec which is important for workload seamless if any error happens.
>> ii) smaller downtime since we could remove the vm_start() downtime out of the frozen window.
>> Drawbacks
>> i)need more codes to handle including fork,address/ports conflict between parent and child.
>> ii)more complex life cycle management for the two processes.
>>
>> 2.How
>> The cpr framework is flexible and scalable, and maybe we can make use of most codes to support both execvp and fork+exec mode.
>> However, we may need to do more work compared to execvp method.
>> i) do fork mode in a thread like migration thread
>> ii) make parent and child talk to each other through socket or anonymous pipe
>> iii)make use of sharing mechanism of fds in cpr framework including memfd, vfio and devices fds
>> iv)deal with the conflict about the socket address and port like vnc (do by reuse port and pass the different args by cprexec)
>> v) do life cycle managements for two qemu processes and need parent exit and reconnection for the child at last by the management service
>>
>> Please tell me if I am missing something important:)
> 
> Hi Zheng, that list sounds about right.  However, additional kernel changes would be needed to 
> change ownership of the vfio device descriptors. The vfio module records the mm of the creating
> process, and does not allow other processes to unmap ranges.  Also, the mm->locked_vm would 
> need to be transferred to the new process.
> 
Oh,That's right. Maybe we could update them along with VFIO_DMA_MAP_FLAG_VADDR.

> Fork+exec could be a new mode to the cprsave command.
>
Yeah, I would be very happy to see it in the future:)
> - Steve
> .
> 

-- 
Regards.
Chuan


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

end of thread, other threads:[~2021-08-05 14:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 13:10 [PATCH V5 00/25] Live Update [restart] : fork mode? Zheng Chuan
2021-08-04  9:30 ` Zheng Chuan
2021-08-04 20:50 ` Steven Sistare
2021-08-05 14:04   ` Zheng Chuan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.