Using the _KTHREAD data structure with the address of a selected thread, we can see the _GROUP_AFFINITY data structure:
Using the same address of the thread, we can use it with the _GROUP_AFFINITY data structure, and gather the following output:
Processor Groups are only available on x64 versions of Windows 7, Windows 8, Windows Server 2008 R2 edition and Windows Server 2012 edition. Each physical processor usually has multiple cores, which provide multiple logical processors for the operating system to utilize.
The current definitions and differences are described below:
- Physical Processor - The physical CPU and socket.
- Logical Processor - One unit which can perform calculations and perform tasks.
- Core - One processor unit.
By default and at the beginning of a process' lifetime, it is assigned to one processor group, and any subsequent threads belonging to that process are also assigned to the same group number.
On the other hand, if a process need to run across multiple processor groups, then it must set each thread to the correct processor affinity mask. Using the INHERIT_PARENT_AFFINITY flag to set a parent process, any child processes can be set to run on a particular affinity mask, or if the processor needs to remain in the same group but be able to spread across multiple processor groups, then GetProcessAffinityMask and SetProcessAffinityMask can be called to edit the affinity mask of the process and then threads.
The other field I would like to discuss is the Mask field, which was another confusing aspect for me, since at first I would it was referring to the number of cores for my processor, which would have been 2, but the value here is 6. The field refers to the number of logical processors within that processor group specified by the Group field, and which logical processors a thread can run on.
The _GROUP_AFFINITY data structure can also be used to set interrupt affinities, to restrict which processor groups can receive interrupts.
References:
Processor Groups (Windows)
Windows Driver Kit Documentation
Bsodtutorials: Processor Groups - _Group_Affinity >>>>> Download Now
ReplyDelete>>>>> Download Full
Bsodtutorials: Processor Groups - _Group_Affinity >>>>> Download LINK
>>>>> Download Now
Bsodtutorials: Processor Groups - _Group_Affinity >>>>> Download Full
>>>>> Download LINK E3