All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
	Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v4 2/2] selftests/ve: check memory.numa_migrate keeps the folio order
Date: Wed, 28 Oct 2026 23:25:12 +0000	[thread overview]
Message-ID: <010701a184d4f80d-d1af61fc-e25b-4eca-9898-8b1c5c4a0de8-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261029-b4-prep-khorenko-vstor-151607-numa-migrate-order-v4-2-cf966bf93405@virtuozzo.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests/ve: numa_migrate test leaves +memory +cpuset enabled in root cgroup
--

commit cd13e136e28785e40b5f6accc767a4d1481054d6
Author: Konstantin Khorenko <khorenko@virtuozzo.com>

selftests/ve: check memory.numa_migrate keeps the folio order

This adds a selftest that writes a file on an XFS image from a cgroup
bound to one NUMA node, migrates the cgroup to a second node with
memory.numa_migrate, and checks that the data reads back intact and that
large folios kept their order. It tracks the folios through
/proc/self/pagemap, /proc/kpageflags and move_pages().

Link: https://virtuozzo.atlassian.net/browse/VSTOR-151607

> diff --git a/tools/testing/selftests/ve/ve_numa_migrate_test.c b/tools/testing/selftests/ve/ve_numa_migrate_test.c
> new file mode 100644
> --- /dev/null
> +++ b/tools/testing/selftests/ve/ve_numa_migrate_test.c

[ ... ]

> +static void cleanup(FIXTURE_DATA(numa_migrate) *self)
> +{
> +	char path[PATH_MAX];
> +
[ ... ]
> +	if (self->cgv2_fd >= 0) {
> +		/* The test task may still sit in the cgroup after a failure. */
> +		write_u64_at(self->cgv2_fd, "cgroup.procs", getpid());
> +		unlinkat(self->cgv2_fd, CG_NAME, AT_REMOVEDIR);
> +		close(self->cgv2_fd);
> +		self->cgv2_fd = -1;
> +	}
> +}
> +
[ ... ]
> +static int prepare(FIXTURE_DATA(numa_migrate) *self, const char **why)
> +{
> +	int fd;
> +
> +	self->cgv2_fd = mount_cg2_fd();
> +	if (self->cgv2_fd < 0) {
> +		*why = "cannot mount cgroup2";
> +		goto fail;
> +	}
> +	if (write_file_at(self->cgv2_fd, "cgroup.subtree_control",
> +			  "+memory +cpuset")) {

[Severity: Low]
This isn't a functional defect in the checked logic, but prepare() writes
"+memory +cpuset" to the root cgroup.subtree_control, and cleanup() only
removes the CG_NAME cgroup with unlinkat(AT_REMOVEDIR).

Is it intended that cleanup() never writes "-cpuset -memory" back?

On a host where the root had neither controller enabled in
subtree_control, every run changes the host-wide cgroup2 controller state,
since the mount from mount_cg2_fd() is a view of the single cgroup2
hierarchy. Later tests may then see different controller delegation.

If the test is killed or times out, the harness skips teardown, so the
loop mount, the image file and the /var/tmp/ve_numa_migrate.* directory
can also be left behind.

Could prepare() record whether the controllers were already enabled, and
could cleanup() restore the previous state?

> +		*why = "cannot enable the memory and cpuset controllers";
> +		goto fail;
> +	}

[ ... ]

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261029-b4-prep-khorenko-vstor-151607-numa-migrate-order-v4-0-cf966bf93405@virtuozzo.com?part=2

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

  reply	other threads:[~2026-10-28 23:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 23:17 [Devel] [PATCH hci-8.1 v4 0/2] mm/memcontrol: numa_migrate destinations of the source " Konstantin Khorenko
2026-10-28 23:17 ` [Devel] [PATCH hci-8.1 v4 1/2] mm/memcontrol: allocate numa_migrate targets " Konstantin Khorenko
2026-10-28 23:21   ` no-reply
2026-10-28 23:17 ` [Devel] [PATCH hci-8.1 v4 2/2] selftests/ve: check memory.numa_migrate keeps the " Konstantin Khorenko
2026-10-28 23:25   ` no-reply [this message]
2026-10-29  9:40 ` [Devel] [PATCH hci-8.1 v4 0/2] mm/memcontrol: numa_migrate destinations of the source " Konstantin Khorenko

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=010701a184d4f80d-d1af61fc-e25b-4eca-9898-8b1c5c4a0de8-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    --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.