View Single Post
Old 2022-06-19, 12:26   #22
rogue's Avatar
Apr 2003
Between here and the

673610 Posts

Originally Posted by kruoli View Post
You first decide on which core to start on. In your example, everything from 0–3 would be feasible as a start core. That would either involve performance cores 0–6 or 1–7. I would leave performance core 0 free because a lot of kernel thongs are still done on core 0 on windows. This would lead to:
AffinitySetter -s 3 -m 7 llr64,
assuming your executable is called llr64. The option -i does not need to be added since it is the default on Windows. Leave it running in background. It will automatically detect newly spawned processes.
Does it keep running and poll the system every few minutes to determine if the affinity of a process needs to be changed?

After running for a few minutes, it is doing nothing. I see no change in the affinity of the processes. I suggest a few things:

1) Add a switch that indicates if hyper threading is enabled. That way -s 1 -H -m 3 would use cores 1, 3, 5 and -S -m 3 would use cores 1, 2, 3.
2) Output information such as "no process found with that name".
3) Output information such as "process <processname> with pid <pid>" changed to use core <core>.
4) Add a switch to specify the number of seconds to poll the OS for running processes to change. Default to 60 seconds.

This means that your program will need to have a table of pids for which it changed the affinity so that it doesn't need to change them each time (and output that the affinity was changed) the system is polled.

Last fiddled with by rogue on 2022-06-19 at 12:36
rogue is offline   Reply With Quote