WindowsInternals
WindowsInternals copied to clipboard
How to "escape" the system-wide CPU set?
Thanks for a great book Pavel, and for sharing code samples. I'm interested in using CPU Sets to dedicate certain CPU cores to real-time signal processing tasks.
I've played a bit with CpuSet.exe based on the instructions in Windows Internals 7th ed. Part 1, and have successfully managed to change the system-wide CPU set. Changing the CPU set for a given process also works, but only within the system-wide CPU set. This means that I'm not able to reproduce "EXPERIMENT: CPU sets" in the book where CPU 0 is dedicated to the CPUSTRESS process.
Any advise on how to configure a process to "escape" the system-wide CPU set, so that it can get dedicated CPU cores?
Not sure if it's relevant, but I'm running Win10 Pro version 1903 (64bit) build 18362.267.
Hi Fredrik, It should work... at least it did back then in the RS1 days. I'll have to test it myself, but essentially CPU sets should allow escaping from the system CPU set just a thread can escape its process CPU set.
@zodiacon Any updates on reproducing this issue?
Sorry, I've been super busy with work and other stuff and didn't get around to it yet.
Gentle reminder.
Really sorry for the crazy delay... It seems to work ok if you also set affinity for the process, not just the CPU set
It also seems that at some point the system CPU set is reset, need further testing to understand why.
It also seems that at some point the system CPU set is reset, need further testing to understand why.
I've also experienced the same behavior, which really puzzled me.
Status update: Microsoft have published How to set up a Device for Real-Time Performance
that documents a MDM_WindowsIoT_SoftRealTimeProperties01
management interface for configuring the system-wide CPU set. I guess this is the recommended interface for doing so.
Thank you for this.
@forderud Have you successfully run an application on a dedicated CPU?
Can the MDM_WindowsIoT_SoftRealTimeProperties01
setting be used on any Windows 10/11 or only on Windows IoT?
@forderud Have you successfully run an application on a dedicated CPU? Can the
MDM_WindowsIoT_SoftRealTimeProperties01
setting be used on any Windows 10/11 or only on Windows IoT?
I just tested on a Windows 11 Pro 21H2, and SoftRT seemed to work fine there.
Just follow the instructions on https://learn.microsoft.com/en-us/windows/iot/iot-enterprise/soft-real-time/soft-real-time-device#use-mdm-bridge-wmi-provider-to-configure-the-windowsiot-csp if you want to test yourself. I recommend testing in a VM, since it's difficult (and possibly impossible) to disable the feature after being enabled.
I'll try it. Thanks! Or do you know that it is not possible to stably handle a callback in which a CRC is calculated every 10 ms? Is this possible with soft real time or only with hard real time? Hard real time should be possible with a dedicated CPU core (CPU set?) right?
@forderud Have you successfully run an application on a dedicated CPU? Can the
MDM_WindowsIoT_SoftRealTimeProperties01
setting be used on any Windows 10/11 or only on Windows IoT?I just tested on a Windows 11 Pro 21H2, and SoftRT seemed to work fine there.
Just follow the instructions on https://learn.microsoft.com/en-us/windows/iot/iot-enterprise/soft-real-time/soft-real-time-device#use-mdm-bridge-wmi-provider-to-configure-the-windowsiot-csp if you want to test yourself. I recommend testing in a VM, since it's difficult (and possibly impossible) to disable the feature after being enabled.
The feature can be reverted by deleting the ReservedCpuSets
registry key. I created a program to extend the functionality of the feature in amitxv/ReservedCpuSets
Thanks a lot for informing about the HKLM\System\CurrentControlSet\Control\Session Manager\kernel\ReservedCpuSets
registry key @amitxv. This seems like a useful short-term fix for disabling Soft-RT.
I've added a note of the registry key in a Document how to disable Soft-RT enhancement request to Microsoft that I've previously opened.