sched_getaffinity() always returns the full cpu mask

Christian Franke Christian.Franke@t-online.de
Mon Mar 10 11:44:55 GMT 2025


Mark Geisert via Cygwin wrote:
> Hi Christian,
>
> On 3/8/2025 9:11 AM, Christian Franke via Cygwin wrote:
>> Testcase:
>>
>> $ grep processor /proc/cpuinfo | tail -1 # i7-14700K
>> processor       : 27
>>
>> $ sleep 60 & taskset 0x1 sleep 60 &
>> [1] 62094
>> [2] 62095
>>
>> $ taskset -p 62094
>> pid 62094's current affinity mask: fffffff
>>
>> $ taskset -p 62095
>> pid 62095's current affinity mask: fffffff
>
> This may well be the first test of Cygwin's affinity support on a 
> system where the cpu mask bit length isn't a power of 2.  I did test 
> such but seeing it on hardware is another matter.
>
> Are there in fact just 28 hardware processors on this system? ...

One physical cpu with 20 cores and 28 threads (i7-14700K: 8P/HT + 12E)

GetProcessAffinityMask(., ., &sysmask) returns sysmask=0xfffffff
GetProcessGroupAffinity(., &groupcount, grouparray) returns 
groupcount=1, grouparray[0] = 0

> ... Does Windows (or Linux for that matter) allow one to set cpu group 
> size?  I would think the BIOS would want control over that, with the 
> OSs just providing read access to what was chosen.  For 28 processors, 
> a single group of 28 processors, or either 4 groups of 7 procs, or 
> 7x4, or even 2x14 or 14x2 are plausible if not all useful.

I guess cpu groups are intended to reflect the physical cpus. I don't 
know whether this assignment could be changed.

-- 
Regards,
Christian



More information about the Cygwin mailing list