[Devel] [PATCH hci-8.1 v5 1/2] sched: Fix sched_getaffinity syscall

Konstantin Khorenko khorenko at virtuozzo.com
Thu Nov 19 20:32:30 MSK 2026


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



More information about the Devel mailing list