<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hello,</p>
<p><br />Thanks a lot Alex for your response.</p>
<p>There is one thing I would just like to be sure to have understood properly from your message. Do you mean that the process will redo the futex_wait system calls on restoration ?</p>
<p>Best regards,</p>
<p>Dorian Goepp</p>
<p>Le 2022-07-07 14:34, Alexander Mikhalitsyn a &eacute;crit&nbsp;:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Hello, dear friends,<br /> <br /> Yep, CRIU definitely handles futexes carefully. It's one of the most<br /> important things.<br /> We support both robust and regular futexes.<br /> <br /> As far as you know futexes work only on a shared memory basis, so for<br /> non-robust futex<br /> there is no need to have any special handling. We are just dumping the<br /> whole process memory contents.<br /> So after the restore we just need to ensure that threads instruction<br /> pointers (IP) are properly set<br /> (for instance we need to perform manual "syscall restart" for futexes<br /> (see compel_get_task_regs()).<br /> <br /> For robust futexes we have a special handling here:<br /> <a href="https://github.com/checkpoint-restore/criu/blob/c8f9880adab038481f7806173b698fc6e17ba76a/criu/cr-dump.c#L565">https://github.com/checkpoint-restore/criu/blob/c8f9880adab038481f7806173b698fc6e17ba76a/criu/cr-dump.c#L565</a><br /> <a href="https://github.com/checkpoint-restore/criu/blob/c8f9880adab038481f7806173b698fc6e17ba76a/criu/pie/restorer.c#L532">https://github.com/checkpoint-restore/criu/blob/c8f9880adab038481f7806173b698fc6e17ba76a/criu/pie/restorer.c#L532</a><br /> <br /> Regards,<br /> Alex<br /> <br /> On Thu, Jul 7, 2022 at 3:13 PM Adrian Reber &lt;<a href="mailto:adrian@lisas.de">adrian@lisas.de</a>&gt; wrote:
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><br /> Please try to submit your question as a github issue. Much higher<br /> chances of getting an answer there.<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adrian<br /> <br /> On Thu, Jul 07, 2022 at 01:39:17PM +0200, Dorian Goepp wrote:
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Hi,<br /> <br /> Is this the right place to ask questions about CRIU's features and<br /> internals?<br /> <br /> If so, I have been considering CRIU for dumping and restoring a process<br /> with a set of threads synchronised through futexes [<a href="https://man7.org/linux/man-pages/man2/futex.2.html">1</a>]. It seems to<br /> work, but, I cannot tell from the documentation (wiki) whether it is<br /> officially supported, or just accidentally works for the cases I tested<br /> it with.<br /> <br /> I could not find which parts would take care of the state of the<br /> futex_wait system call in CRIU's source code, except maybe for<br /> `get_task_regs()` in crui/compel/arch/x86/src/lib/infect.c (I run it on<br /> an amd64 processor). This function issues the warning "Will restore %d<br /> with interrupted system call" when I dump the futex-heavy process. Is it<br /> enough to save the process's register state to resume the futex system<br /> call correctly ?<br /> <br /> Best regards,<br /> <br /> Dorian Goepp<br /> <br /> Links:<br /> ------<br /> [1] <a href="https://man7.org/linux/man-pages/man2/futex.2.html">https://man7.org/linux/man-pages/man2/futex.2.html</a></blockquote>
<br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">_______________________________________________<br /> CRIU mailing list<br /> <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br /> <a href="https://lists.openvz.org/mailman/listinfo/criu">https://lists.openvz.org/mailman/listinfo/criu</a></blockquote>
_______________________________________________<br /> CRIU mailing list<br /> <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br /> <a href="https://lists.openvz.org/mailman/listinfo/criu">https://lists.openvz.org/mailman/listinfo/criu</a></blockquote>
</div>
</blockquote>
</body></html>