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

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Wed Nov 18 22:47:54 MSK 2026


> We observed incorrect cpu numbers inside containers:
> [root at 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.
> [ ... ]
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-141682
> Fixes: 17e30fe0e094 ("sched: Return only virtual cpus in sched_getaffinity()")
> Feature: sched: virtualize CT cpu affinity management
> Signed-off-by: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261118-ct-invalid-nrpoc-v4-0-30baaeda3f87@virtuozzo.com?part=1




More information about the Devel mailing list