All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 1/2] fs/aio: restore the AIO ring of the dumped size in a pseudosuper VE
Date: Fri, 13 Nov 2026 20:41:41 +0100	[thread overview]
Message-ID: <179459890135.57567.12439437565244725963.b4-review@b4> (raw)
In-Reply-To: <20261113-pr-ptikhomirov-vstor-154129-aio-pseudosuper-ring-v1-1-7d35d143fdc3@virtuozzo.com>

I won't apply this version, please send v2 with the changes below.

On Fri, 13 Nov 2026 16:08:44 +0100, Pavel Tikhomirov wrote:
> After a migration to a node with more possible CPUs an AIO context can
> be slightly less reliable: io_submit() can return EAGAIN before the ring
> is full, while free slots sit in the per-CPU caches of other CPUs.

Item 1 of the cover letter reply: keep a restored small ring out of
the per-CPU slot caches, or state the real bound here.

Why: the doubling relies on the heuristic: with at least 8 events per
possible CPU, the slots cached on other CPUs stay below half the ring.
A restored ring has no such floor. req_batch drops to 1, and
put_reqs_available() leaves one slot on every CPU a completion runs on,
which only a submit from that CPU takes back.

A one-page ring dumped on 4 CPUs comes from io_setup() of up to 62
events and has 126 usable slots. Restored on a big node,
io_submit() returns EAGAIN with fewer requests in flight than the
application asked for once completions have run on more than 64 other
CPUs. Once 126 CPUs hold a slot, it returns EAGAIN with nothing in
flight, and an application that then waits for a completion hangs.
Before the patch this migration failed cleanly and the CT stayed on
the source node.

> Skip the CPU heuristic while the VE is pseudosuper, which it is only for
> the restore. Keep the other adjustments, the doubling and the rounding

Item 2 of the cover letter reply: the VE is also pseudosuper during
every CT start.

Why: libvzctl do_env_create() sets ve.pseudosuper on every start, and
the CT's first task clears it just before it execs init. vzctl runs no
AIO in that window, so the code is fine, but the message and the
comment ("skip the heuristic on restore") say otherwise.

> gets a bigger ring, and the restore fails. E.g. io_setup(1) makes a

Item 3 of the cover letter reply: say what the user sees.

Why: CRIU's restore_aio_ring() compares the new ring with the dumped
one, reports "wrong aio" and the migration is aborted.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-11-13 19:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 15:08 [Devel] [PATCH hci-8.1 0/2] fs/aio: fix CT migration with AIO to a node with more CPUs Pavel Tikhomirov
2026-11-13 15:08 ` [Devel] [PATCH hci-8.1 1/2] fs/aio: restore the AIO ring of the dumped size in a pseudosuper VE Pavel Tikhomirov
2026-11-13 15:14   ` no-reply
2026-11-13 19:41   ` Konstantin Khorenko [this message]
2026-11-13 15:08 ` [Devel] [PATCH hci-8.1 2/2] selftests/ve: check the AIO ring " Pavel Tikhomirov
2026-11-13 15:15   ` no-reply
2026-11-13 19:41   ` Konstantin Khorenko
2026-11-13 19:41 ` [Devel] [PATCH hci-8.1 0/2] fs/aio: fix CT migration with AIO to a node with more CPUs Konstantin Khorenko
2026-11-16 10:33   ` Pavel Tikhomirov
2026-11-16 10:35     ` Pavel Tikhomirov
2026-11-16 10:35   ` Pavel Tikhomirov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179459890135.57567.12439437565244725963.b4-review@b4 \
    --to=khorenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=ptikhomirov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.