Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: ReservedCPUSets and RSS and AffinityMask #4

Open
giovaorama opened this issue Nov 7, 2024 · 1 comment
Open

Question: ReservedCPUSets and RSS and AffinityMask #4

giovaorama opened this issue Nov 7, 2024 · 1 comment

Comments

@giovaorama
Copy link

Hi,
If I understand correctly the README, while "SetRTCores essentially prevents interrupts and tasks from being scheduled on reserved cores so that you can isolate real-time applications from user and kernel-level disturbances by configuring affinity policies." this tools allows to "hide" some CPU threads from the scheduler if no one explicity override this choice.

Once reserved the Windows scheduler will not schedule user threads and application on these CPU threads, right?
But what about the RSS threads and the handling of the interrupts.

Let me made a concrete examples. Suppose I have 32 CPU threads (16 cores+16 hyper threading). I reserve the last 8 this this tool
Then I can, for instance, reserve the last 8 CPU threads using this tool and then set the Receive Side Scaling to use them instead with something like

Get-NetAdapterRSS -name MyNIC -BaseProcessorNumber 23 -MaxProcessorNumber 32

And this seems to work. And in this way the NDIS will use the CPU threads 23/25/27/29/31 (physical) for RSS. A similar settings can be done using another tool to tell Windows to use just some CPU threads to handling the interrupts of the devices (i found a tool name GoInterruptPolicy for instance).

But If I understand correctly, any calls in an application of SetThreadAffinityMask() (or a SetProcessAffinityMask()) can override this reservation and enabling the scheduler to schedule also on the previously reserved CPU threads.

Do I miss something?

Thanks in advance.

@valleyofdoom
Copy link
Owner

valleyofdoom commented Nov 7, 2024

Everything you said is correct although, I would double check whether RSS base processor has higher precedence than reserved CPUs. I'm pretty sure it does but it has been a while since I have checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants