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

Konstantin Khorenko khorenko at virtuozzo.com
Thu Nov 12 21:37:40 MSK 2026


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

On Thu, 29 Oct 2026 11:16:06 +0100, Vladimir Riabchun <vladimir.riabchun at virtuozzo.com> wrote:
> The root cause is incorrect bitmap_fill usage - it sets whole
> integers only, without handling bit tails, so the actual number of
> set bits is 64 = bits in ULONG.

Items 1 and 2 of the cover letter reply: add the Fixes: and Feature:
trailers, write "whole unsigned longs", and say what a CT sees now.

Why: 87211cbff4b4 added the CT branch with bitmap_fill(). Since v3
the vCPU limit comes from the target task and the count follows the
cpuset, so nproc may differ from /proc/cpuinfo. A reader of the
message should not have to find that in the cover changelog.

> +		/*
> +		 * setaffinity is not available inside CT, so these bits
> +		 * can only be used for counting.

Item 3: sched_setaffinity() returns 0 in a CT and does nothing, it is
not "not available".

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list