* [Devel] [PATCH hci-8.1 v5 0/2] sched: Fix incorrect nproc report inside CT
@ 2026-11-19 9:54 Vladimir Riabchun
2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 1/2] sched: Fix sched_getaffinity syscall Vladimir Riabchun
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Vladimir Riabchun @ 2026-11-19 9:54 UTC (permalink / raw)
To: Konstantin Khorenko; +Cc: devel, Sashiko
We observed weird nproc behavior - it reported 64 CPUs
no matter what the CT limits were or how many CPUs the host
actually had.
nproc code uses sched_getaffinity syscall under the hood[1].
It appears that this syscall returned complete nonsence when
called from VE - we ignored both num_online_vcpus and
cgroup cpuset limitations.
Now it is fixed and a new selftest is added.
[1]: https://github.com/coreutils/gnulib/blob/master/lib/nproc.c#L144
https://virtuozzo.atlassian.net/browse/VSTOR-141682
Signed-off-by: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>
---
Changes in v5:
- Patch 2: fixed incorrect byte size passed to sched_getaffinity,
added check for root and removed extra line.
- Link to v4: http://lore.virtuozzo.com/20261118-ct-invalid-nrpoc-v4-0-30baaeda3f87@virtuozzo.com
Changes in v4:
- Patch 1: updated comment about setaffinity and commit mesage.
- Patch 2: added include and used CPU_SETSIZE.
- Link to v3: http://lore.virtuozzo.com/20261029-ct-invalid-nrpoc-v3-0-89d4b0b7d520@virtuozzo.com
Changes in v3:
- Patch 1: num_online_vcpus() -> task_nr_cpus(p)
- Patch 2: updated a comment and moved CPU check in setup fixture to the top.
- Link to v2: http://lore.virtuozzo.com/20261028-ct-invalid-nrpoc-v2-0-968fe985ce27@virtuozzo.com
Changes in v2:
- Updated vCPU logic in patch 1. Now we don't return actual
cpumask, insted first min(vcpu, count(mask)) bits are set.
This is closer to the real CT resources.
- Patch 2: adjusted logic and added one more test.
- Link to v1: http://lore.virtuozzo.com/20261027-ct-invalid-nrpoc-v1-0-48727c3afe16@virtuozzo.com
---
Vladimir Riabchun (2):
sched: Fix sched_getaffinity syscall
selftests: ve: Test sched_getaffinity in VE
kernel/sched/syscalls.c | 18 +-
tools/testing/selftests/ve/.gitignore | 1 +
tools/testing/selftests/ve/Makefile | 1 +
.../selftests/ve/ve_sched_getaffinity_test.c | 214 +++++++++++++++++++++
4 files changed, 229 insertions(+), 5 deletions(-)
---
base-commit: d816dd0e4cdc45208ba0c488d295c5b2f943e079
change-id: 20261027-ct-invalid-nrpoc-f183b3ba691d
Best regards,
--
Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 7+ messages in thread* [Devel] [PATCH hci-8.1 v5 1/2] sched: Fix sched_getaffinity syscall 2026-11-19 9:54 [Devel] [PATCH hci-8.1 v5 0/2] sched: Fix incorrect nproc report inside CT Vladimir Riabchun @ 2026-11-19 9:54 ` Vladimir Riabchun 2026-11-19 17:32 ` Konstantin Khorenko 2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 2/2] selftests: ve: Test sched_getaffinity in VE Vladimir Riabchun 2026-11-19 17:32 ` [Devel] [PATCH hci-8.1 v5 0/2] sched: Fix incorrect nproc report inside CT Konstantin Khorenko 2 siblings, 1 reply; 7+ messages in thread From: Vladimir Riabchun @ 2026-11-19 9:54 UTC (permalink / raw) To: Konstantin Khorenko; +Cc: devel, Sashiko We observed incorrect cpu numbers inside containers: [root@localhost ~]# nproc 64 even when there were much less physical/virtual CPUs. The root cause is incorrect bitmap_fill usage - it sets whole longs only, without handling bit tails, so the actual number of set bits is 64 = bits in ULONG. If we use cpumask only or vcpus only, nproc and other getaffinity users will get incorrect info about CT resources. We can't run on more than count(cpuset) CPUs and we are limited by vCPU number. So the minimum of these two is the real limit. Return first bits set - anyway they can't be used for anything except counting from inside CT. Host behavior is not changed. It is also intentional that we perform VE check against current exec env - CT users will get virtualized view and host users will get real affinity without vCPU info. This fixes only getaffinity syscall, its value may be lower than /proc/cpuinfo or /sys/devices/system/cpu/online. This is expected. https://virtuozzo.atlassian.net/browse/VSTOR-141682 Fixes: 17e30fe0e094 ("sched: Return only virtual cpus in sched_getaffinity()") Feature: sched: virtualize CT cpu affinity management Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com> Signed-off-by: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com> --- kernel/sched/syscalls.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c index 6d921043e9e7..274d897f52cd 100644 --- a/kernel/sched/syscalls.c +++ b/kernel/sched/syscalls.c @@ -1316,15 +1316,23 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask) if (retval) return retval; + scoped_guard (raw_spinlock_irqsave, &p->pi_lock) { + cpumask_and(mask, &p->cpus_mask, cpu_active_mask); + } + if (!ve_is_super(get_exec_env())) { + /* + * setaffinity is a no-op inside CT, so these bits + * can only be used for counting. + * We can't have more than vcpus and we can't run on CPUs + * outside the mask. Reporting smallest will provide true + * information about CT resources. + */ + unsigned int vcpus_avail = min(task_nr_cpus(p), cpumask_weight(mask)); cpumask_clear(mask); - bitmap_fill(cpumask_bits(mask), num_online_vcpus()); - return 0; + bitmap_set(cpumask_bits(mask), 0, vcpus_avail); } - guard(raw_spinlock_irqsave)(&p->pi_lock); - cpumask_and(mask, &p->cpus_mask, cpu_active_mask); - return 0; } -- 2.52.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Devel] [PATCH hci-8.1 v5 1/2] sched: Fix sched_getaffinity syscall 2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 1/2] sched: Fix sched_getaffinity syscall Vladimir Riabchun @ 2026-11-19 17:32 ` Konstantin Khorenko 0 siblings, 0 replies; 7+ messages in thread From: Konstantin Khorenko @ 2026-11-19 17:32 UTC (permalink / raw) To: Vladimir Riabchun; +Cc: devel, Sashiko I won't apply this version, please send v6, items 1 and 2 of the cover letter reply. On Thu, 19 Nov 2026 10:54:02 +0100, Vladimir Riabchun wrote: > We can't run on more than count(cpuset) CPUs and we are > limited by vCPU number. So the minimum of these two is the Item 2: the vCPU number is task_nr_cpus(p) of the target task, not of the caller; say so. On your question in the v3 thread: keep sched_setaffinity() returning 0 in a CT. -EPERM would fail taskset, numactl and systemd units with CPUAffinity= inside CTs, and the no-op is what makes the prefix mask from sched_getaffinity() harmless to pass back. If you still want -EPERM, it is a patch and a ticket of its own. -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Devel] [PATCH hci-8.1 v5 2/2] selftests: ve: Test sched_getaffinity in VE 2026-11-19 9:54 [Devel] [PATCH hci-8.1 v5 0/2] sched: Fix incorrect nproc report inside CT Vladimir Riabchun 2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 1/2] sched: Fix sched_getaffinity syscall Vladimir Riabchun @ 2026-11-19 9:54 ` Vladimir Riabchun 2026-11-19 10:01 ` no-reply 2026-11-19 17:32 ` Konstantin Khorenko 2026-11-19 17:32 ` [Devel] [PATCH hci-8.1 v5 0/2] sched: Fix incorrect nproc report inside CT Konstantin Khorenko 2 siblings, 2 replies; 7+ messages in thread From: Vladimir Riabchun @ 2026-11-19 9:54 UTC (permalink / raw) To: Konstantin Khorenko; +Cc: devel Add a new selftest that verifies that sched_getaffinity respects both cgroup cpuset and nr_cpus limits. https://virtuozzo.atlassian.net/browse/VSTOR-141682 Feature: sched: virtualize CT cpu affinity management Signed-off-by: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com> --- tools/testing/selftests/ve/.gitignore | 1 + tools/testing/selftests/ve/Makefile | 1 + .../selftests/ve/ve_sched_getaffinity_test.c | 214 +++++++++++++++++++++ 3 files changed, 216 insertions(+) diff --git a/tools/testing/selftests/ve/.gitignore b/tools/testing/selftests/ve/.gitignore index 3d1179bd2c5f..13dbfc28e3a7 100644 --- a/tools/testing/selftests/ve/.gitignore +++ b/tools/testing/selftests/ve/.gitignore @@ -4,3 +4,4 @@ ve_mount_accounting_test ve_cpuid_override_test ve_vtty_stress ve_numa_migrate_test +ve_sched_getaffinity_test diff --git a/tools/testing/selftests/ve/Makefile b/tools/testing/selftests/ve/Makefile index e96320a18384..34f901c9e4c9 100644 --- a/tools/testing/selftests/ve/Makefile +++ b/tools/testing/selftests/ve/Makefile @@ -7,6 +7,7 @@ TEST_GEN_PROGS += ve_perms_test TEST_GEN_PROGS += ve_mount_accounting_test TEST_GEN_PROGS += ve_vtty_stress TEST_GEN_PROGS += ve_numa_migrate_test +TEST_GEN_PROGS += ve_sched_getaffinity_test # CPUID faulting is x86-64 only. ARCH says "x86" for 32-bit too and lib.mk # picks the clang target by its emptiness, so decide by the compiler. diff --git a/tools/testing/selftests/ve/ve_sched_getaffinity_test.c b/tools/testing/selftests/ve/ve_sched_getaffinity_test.c new file mode 100644 index 000000000000..969daf32ffdb --- /dev/null +++ b/tools/testing/selftests/ve/ve_sched_getaffinity_test.c @@ -0,0 +1,214 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ve_sched_getaffinity selftests + * + * Tests to check cpuset virtualization. + * Not suitable for running inside CT. + */ +#define _GNU_SOURCE +#include <asm/unistd.h> +#include <linux/sched.h> +#include <sys/mman.h> +#include <sys/syscall.h> +#include <sys/stat.h> +#include <errno.h> +#include <sched.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> + +#include "../kselftest_harness.h" +#include "ve_selftest.h" + +FIXTURE(ve_getaff_test) +{ + int cgv2_fd; + int ctid; + struct namespace_ctx ns_ctx; + cpu_set_t orig_cpuset; + int orig_cpucount; +}; + +static int __getaffinity_ve(void *cpuset) +{ + cpu_set_t *dst = cpuset; + + return sched_getaffinity(getpid(), sizeof(cpu_set_t), dst); +} + +static int getaffinity_ve(FIXTURE_DATA(ve_getaff_test) * self, cpu_set_t *dst) +{ + int ret = -1; + cpu_set_t *tmp = mmap(NULL, sizeof(cpu_set_t), + PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); + + if (tmp == MAP_FAILED) { + fprintf(stderr, "Failed to mmap shared region: %s\n", strerror(errno)); + return -1; + } + CPU_ZERO(tmp); + CPU_ZERO(dst); + + ret = run_in_ve(self->cgv2_fd, self->ctid, &self->ns_ctx, + CLONE_NEWVE, __getaffinity_ve, tmp); + + if (!ret) + memcpy(dst, tmp, sizeof(cpu_set_t)); + + munmap(tmp, sizeof(cpu_set_t)); + return ret; +} + +static int check_cpumask_is_prefix(cpu_set_t *mask, int expected) +{ + int i, count = CPU_COUNT(mask); + + if (expected >= 0 && expected != count) { + fprintf(stderr, "cpumask count mismatch: %d != %d\n", expected, count); + return 0; + } + for (i = 0; i < count; i++) { + if (!CPU_ISSET(i, mask)) { + fprintf(stderr, "cpumask is not a prefix: %d is OFF\n", i); + return 0; + } + } + return 1; +} + +static int get_nth_cpu(cpu_set_t *mask, int n) +{ + int i; + + for (i = 0; i < CPU_SETSIZE; i++) { + if (!CPU_ISSET(i, mask) || --n) + continue; + + return i; + } + return -1; +} + +FIXTURE_SETUP(ve_getaff_test) +{ + if (geteuid()) + SKIP(return, "needs root"); + + ASSERT_EQ(sched_getaffinity(getpid(), sizeof(cpu_set_t), &self->orig_cpuset), 0); + self->orig_cpucount = CPU_COUNT(&self->orig_cpuset); + if (self->orig_cpucount < 2) + SKIP(return, "Not enough CPUs available"); + + self->cgv2_fd = mount_cg2_fd(); + ASSERT_GE(self->cgv2_fd, 0); + + ASSERT_EQ(write_file_at(self->cgv2_fd, "cgroup.subtree_control", + VE_CONTROLLERS), 0); + + self->ctid = make_ve(self->cgv2_fd, CTID_MIN); + ASSERT_GE(self->ctid, 0); + + ASSERT_EQ(prepare_namespaces(&self->ns_ctx, CLONE_NEWVE, + self->cgv2_fd, self->ctid), 0); +} + +FIXTURE_TEARDOWN(ve_getaff_test) +{ + close_namespace_fds(&self->ns_ctx); + destroy_ve(self->cgv2_fd, self->ctid); + close(self->cgv2_fd); +} + +/* Test correct processing of cpuset.cpus updates */ +TEST_F(ve_getaff_test, update_cg_cpuset) +{ + char path[PATH_MAX]; + int cpu_leave; + cpu_set_t in_ve; + + snprintf(path, sizeof(path), "%d/cpuset.cpus", self->ctid); + if (faccessat(self->cgv2_fd, path, F_OK, 0)) + SKIP(return, "CT cgroup doesn't have cpuset.cpus entry"); + + ASSERT_EQ(getaffinity_ve(self, &in_ve), 0); + ASSERT_TRUE(check_cpumask_is_prefix(&in_ve, self->orig_cpucount)); + + /* Find two CPUs and leave the second via cgroup interface */ + cpu_leave = get_nth_cpu(&self->orig_cpuset, 2); + ASSERT_GE(cpu_leave, 0); + ASSERT_EQ(write_u64_at(self->cgv2_fd, path, cpu_leave), 0); + + /* Verify sched_getaffinity sees 1 CPU, that is the first one */ + ASSERT_EQ(getaffinity_ve(self, &in_ve), 0); + ASSERT_TRUE(check_cpumask_is_prefix(&in_ve, 1)); +} + +/* Test correct processing of cpu.nr_cpus updates */ +TEST_F(ve_getaff_test, nr_proc_bound) +{ + char path[PATH_MAX]; + cpu_set_t in_ve; + + snprintf(path, sizeof(path), "%d/cpu.nr_cpus", self->ctid); + if (faccessat(self->cgv2_fd, path, F_OK, 0)) + SKIP(return, "CT cgroup doesn't have cpu.nr_cpus entry"); + + /* We expect here CPU_COUNT >= 2 */ + ASSERT_EQ(getaffinity_ve(self, &in_ve), 0); + ASSERT_TRUE(check_cpumask_is_prefix(&in_ve, self->orig_cpucount)); + + /* Leave one vCPU */ + ASSERT_EQ(write_u64_at(self->cgv2_fd, path, 1), 0); + + /* Verify sched_getaffinity sees only one vCPU */ + ASSERT_EQ(getaffinity_ve(self, &in_ve), 0); + ASSERT_TRUE(check_cpumask_is_prefix(&in_ve, 1)); +} + +/* Test correct interaction of cpu.nr_cpus and cpuset.cpus */ +TEST_F(ve_getaff_test, limits_interaction) +{ + char path_nr[PATH_MAX], path_set[PATH_MAX], tmp[128]; + int c1, c3; + cpu_set_t in_ve; + + snprintf(path_nr, sizeof(path_nr), "%d/cpu.nr_cpus", self->ctid); + if (faccessat(self->cgv2_fd, path_nr, F_OK, 0)) + SKIP(return, "CT cgroup doesn't have cpu.nr_cpus entry"); + + snprintf(path_set, sizeof(path_set), "%d/cpuset.cpus", self->ctid); + if (faccessat(self->cgv2_fd, path_set, F_OK, 0)) + SKIP(return, "CT cgroup doesn't have cpuset.cpus entry"); + + if (self->orig_cpucount < 3) + SKIP(return, "This test requires at least 3 CPUs"); + + /* We expect here CPU_COUNT >= 3 */ + ASSERT_EQ(getaffinity_ve(self, &in_ve), 0); + ASSERT_TRUE(check_cpumask_is_prefix(&in_ve, self->orig_cpucount)); + + /* Leave two CPUs in cpuset */ + c1 = get_nth_cpu(&self->orig_cpuset, 1); + c3 = get_nth_cpu(&self->orig_cpuset, 3); + ASSERT_TRUE(c1 >= 0 && c3 >= 0); + + snprintf(tmp, sizeof(tmp), "%d,%d", c1, c3); + ASSERT_EQ(write_file_at(self->cgv2_fd, path_set, tmp), 0); + + /* Verify sched_getaffinity sees two vCPU */ + ASSERT_EQ(getaffinity_ve(self, &in_ve), 0); + ASSERT_TRUE(check_cpumask_is_prefix(&in_ve, 2)); + + /* Set vCPU limit to 2 and check that we still have two vCPUs */ + ASSERT_EQ(write_u64_at(self->cgv2_fd, path_nr, 2), 0); + ASSERT_EQ(getaffinity_ve(self, &in_ve), 0); + ASSERT_TRUE(check_cpumask_is_prefix(&in_ve, 2)); + + /* Set vCPU limit to 1 and check that we have one vCPU only */ + ASSERT_EQ(write_u64_at(self->cgv2_fd, path_nr, 1), 0); + ASSERT_EQ(getaffinity_ve(self, &in_ve), 0); + ASSERT_TRUE(check_cpumask_is_prefix(&in_ve, 1)); +} + +TEST_HARNESS_MAIN -- 2.52.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Devel] [PATCH hci-8.1 v5 2/2] selftests: ve: Test sched_getaffinity in VE 2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 2/2] selftests: ve: Test sched_getaffinity in VE Vladimir Riabchun @ 2026-11-19 10:01 ` no-reply 2026-11-19 17:32 ` Konstantin Khorenko 1 sibling, 0 replies; 7+ messages in thread From: no-reply @ 2026-11-19 10:01 UTC (permalink / raw) To: Vladimir Riabchun, Konstantin Khorenko; +Cc: devel Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Low] selftests/ve: CT cgroup leaked when FIXTURE_SETUP asserts after make_ve() - [Low] selftests/ve: unused includes in ve_sched_getaffinity_test.c - [Low] selftests/ve: expected VE CPU count taken from runner affinity, not CT cpuset -- commit 5e9a4b8d7f3a2a0ccd577e3cb0c687874f127e7c Author: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com> selftests: ve: Test sched_getaffinity in VE Adds a selftest that checks sched_getaffinity() inside a VE respects both the CT cgroup cpuset.cpus and cpu.nr_cpus limits. > diff --git a/tools/testing/selftests/ve/ve_sched_getaffinity_test.c b/tools/testing/selftests/ve/ve_sched_getaffinity_test.c > new file mode 100644 > index 000000000000..969daf32ffdb > --- /dev/null > +++ b/tools/testing/selftests/ve/ve_sched_getaffinity_test.c > @@ -0,0 +1,214 @@ > +#define _GNU_SOURCE > +#include <asm/unistd.h> > +#include <linux/sched.h> > +#include <sys/mman.h> > +#include <sys/syscall.h> > +#include <sys/stat.h> > +#include <errno.h> > +#include <sched.h> > +#include <stdio.h> > +#include <stdlib.h> > +#include <unistd.h> > +#include <string.h> [Severity: Low] This isn't a bug, but asm/unistd.h, linux/sched.h, sys/syscall.h, sys/stat.h and stdlib.h are not used by anything in this file. They look copied from a sibling test. Could they be dropped? The double-underscore name __getaffinity_ve is also a style nit. [ ... ] > +FIXTURE_SETUP(ve_getaff_test) > +{ > + if (geteuid()) > + SKIP(return, "needs root"); > + > + ASSERT_EQ(sched_getaffinity(getpid(), sizeof(cpu_set_t), &self->orig_cpuset), 0); > + self->orig_cpucount = CPU_COUNT(&self->orig_cpuset); [Severity: Low] Is orig_cpucount the right expected value for the CT? It is taken from the runner's own affinity mask. The child created by run_in_ve() is attached to the CT cgroup with enter_cgroup(), which replaces its cpus_mask with the cgroup's effective cpus. The runner's narrowed mask is not inherited. The runner is also moved to the root of the private cgroup2 mount at the end of prepare_namespaces(), so orig_cpuset is stale for the rest of the test. If the runner starts under "taskset -c 0,1" on a larger host, orig_cpucount is 2 while the VE reports every online CPU. The first check_cpumask_is_prefix(&in_ve, self->orig_cpucount) then fails spuriously. get_nth_cpu() on orig_cpuset can also pick CPUs that are not in the CT cpuset. Could the expected count come from the CT cgroup's cpuset.cpus.effective instead, or could the test skip when the runner's mask differs from the online set? Also, sched_getaffinity() with sizeof(cpu_set_t) returns EINVAL on machines with more than 1024 CPUs. [ ... ] > + self->ctid = make_ve(self->cgv2_fd, CTID_MIN); > + ASSERT_GE(self->ctid, 0); > + > + ASSERT_EQ(prepare_namespaces(&self->ns_ctx, CLONE_NEWVE, > + self->cgv2_fd, self->ctid), 0); > +} [Severity: Low] Can this leak the CT cgroup created by make_ve()? If ASSERT_GE() on ctid or ASSERT_EQ() on prepare_namespaces() fails, the harness exits before setup_completed is set, so FIXTURE_TEARDOWN never runs. The CT cgroup, its CTID and any namespace fds already saved stay behind. Would it be better to destroy the VE explicitly on these failure paths, or to move the fallible steps out of FIXTURE_SETUP? Carry the trailer below into the next revision and Sashiko will not review this patch again. Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com> -- Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261119-ct-invalid-nrpoc-v5-0-ff22216f458b@virtuozzo.com?part=2 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Devel] [PATCH hci-8.1 v5 2/2] selftests: ve: Test sched_getaffinity in VE 2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 2/2] selftests: ve: Test sched_getaffinity in VE Vladimir Riabchun 2026-11-19 10:01 ` no-reply @ 2026-11-19 17:32 ` Konstantin Khorenko 1 sibling, 0 replies; 7+ messages in thread From: Konstantin Khorenko @ 2026-11-19 17:32 UTC (permalink / raw) To: Vladimir Riabchun; +Cc: devel I won't apply this version, please send v6, items 1 and 3 of the cover letter reply. On Thu, 19 Nov 2026 10:54:03 +0100, Vladimir Riabchun wrote: > + self->cgv2_fd = mount_cg2_fd(); Item 1: on hci-8.2 this is open_cg2_fd(), mount_cg2_fd() is gone. > +#include <asm/unistd.h> > +#include <linux/sched.h> Item 3: unused, as Sashiko said, as are sys/syscall.h, sys/stat.h and stdlib.h. -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Devel] [PATCH hci-8.1 v5 0/2] sched: Fix incorrect nproc report inside CT 2026-11-19 9:54 [Devel] [PATCH hci-8.1 v5 0/2] sched: Fix incorrect nproc report inside CT Vladimir Riabchun 2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 1/2] sched: Fix sched_getaffinity syscall Vladimir Riabchun 2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 2/2] selftests: ve: Test sched_getaffinity in VE Vladimir Riabchun @ 2026-11-19 17:32 ` Konstantin Khorenko 2 siblings, 0 replies; 7+ messages in thread From: Konstantin Khorenko @ 2026-11-19 17:32 UTC (permalink / raw) To: Vladimir Riabchun; +Cc: devel, Sashiko I won't apply this version, please send v6 on top of hci-8.2 with the changes below. 1. Base v6 on hci-8.2 (branch-rh10-6.12.0-211.75.1.26.x.vz10-ovz), not on hci-8.1: the series goes to hci-8.2. v5 does not apply there, patch 2 conflicts in the selftests/ve Makefile and .gitignore lists. With those resolved it still does not build: 26182b5f9943c ("selftests/ve: open the host cgroup2 mount instead of creating one") replaced mount_cg2_fd() with open_cg2_fd(). 2. Patch 1 message: say that the vCPU limit is the one of the target task, task_nr_cpus(p). This part of v3 item 2 is still missing. 3. Patch 2: drop the unused includes Sashiko listed: asm/unistd.h, linux/sched.h, sys/syscall.h, sys/stat.h and stdlib.h. 4. Cover letter: v3 item 6 is still open. The old code did use num_online_vcpus(), the bug was the rounding; "64 no matter what" holds up to 64 vCPUs only; fix the typos "nonsence", "insted" and "mesage"; name the gnulib function instead of linking a line of master. The other v3 items are done, thanks. The Fixes tag on 17e30fe0e094 is right for this branch. On Thu, 19 Nov 2026 10:54:01 +0100, Vladimir Riabchun wrote: > It appears that this syscall returned complete nonsence when > called from VE - we ignored both num_online_vcpus and Item 4: the cover letter text is the same as in v3. Sashiko's other two remarks on v5 2/2 need no change. The CT cgroup is left behind only when prepare_namespaces() fails in the setup, as in ve_mount_accounting_test.c. Under "taskset -c 0,1" the test passes: cpuset_attach() keeps a task's mask when the old and the new cgroup have the same effective CPUs; it would fail only in a cgroup with a narrower cpuset. -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-19 17:33 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-11-19 9:54 [Devel] [PATCH hci-8.1 v5 0/2] sched: Fix incorrect nproc report inside CT Vladimir Riabchun 2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 1/2] sched: Fix sched_getaffinity syscall Vladimir Riabchun 2026-11-19 17:32 ` Konstantin Khorenko 2026-11-19 9:54 ` [Devel] [PATCH hci-8.1 v5 2/2] selftests: ve: Test sched_getaffinity in VE Vladimir Riabchun 2026-11-19 10:01 ` no-reply 2026-11-19 17:32 ` Konstantin Khorenko 2026-11-19 17:32 ` [Devel] [PATCH hci-8.1 v5 0/2] sched: Fix incorrect nproc report inside CT Konstantin Khorenko
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.