Sign in to follow this  
Pochi

I5 460M Affinity Mask : The Truth?

Recommended Posts

Hello there,

 

Ok, ok I play on a laptop but I managed to run FSX quite well actually.

As a matter of fact, I never tried the [Jobscheduler] tweak on my proc because I never found the right value I need to use with my i5. Each website or topics I look in give me different value for the same scenario.

 

Here is my proc : i5 460m. 2 cores with HT ( can nor deactivate HT in bios because there is no such option) so that gives me 4 threads.

 

2 cores with HT = 4 theads

 

So what is the value I should try as Jobsheduler?

 

Thanks in advance for your help,

 

Best regards,

 

Pierre

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Set affinitymask=9.

It won't be hugely different from default 5, but it seems to help windows to schedule the other threads on to core#2, away fro the main thread. You want to see as little activity on core#1 as possible as the main thread on core#0 is sharing the actual physical with it.

 

You wouldn't want to turn off Hyperthreading on a dual core anyway FSX will always work better on a dual core with Hyperthreading on compared to a dual core without Hyperthreading.

Share this post


Link to post
Share on other sites

I'd personally go with 14. In a dual core + HT the main scheduler is going to share it's physical core either with core 0 fibers or a terrain loader so makes no sense to try and isolate it.

14 will have the main scheduler sharing one physical core with fibers and leave 2 terrain loaders hyperthreaded in the second core

Share this post


Link to post
Share on other sites

I'd personally go with 14. In a dual core + HT the main scheduler is going to share it's physical core either with core 0 fibers or a terrain loader so makes no sense to try and isolate it.

14 will have the main scheduler sharing one physical core with fibers and leave 2 terrain loaders hyperthreaded in the second core

Thats's not a good idea at all. Having learnt yet a bit more about how fsx work. What you call fibers is other threads. There are 3 other threads that cause any significant cpu load. One is d3d sound, another one is a debug thread, and a third one is a thread that's responsible for most disc accesses.

Share this post


Link to post
Share on other sites

 

 


There are 3 other threads that cause any significant cpu load. One is d3d sound, another one is a debug thread, and a third one is a thread that's responsible for most disc accesses.

 

Are these the ones locked at core 0? I guess not going by this:

 

 

 

Set affinitymask=9 [...] it seems to help windows to schedule the other threads on to core#2, away fro the main thread

 

Convential wisdom suggests an AF=9 (1001) should place both the main scheduler and those other threads in logical core 0, then one single T&T loader at core 3.

What am I missing here please Lars?

Share this post


Link to post
Share on other sites

 

 


Are these the ones locked at core 0? I guess not going by this:

No, they are not locked to core 0. I know a lot of people thinks that windows processes or 'FSX fibers' are tied to core 0 but that is simply not the case. Window can always shedule threads to run at any cpu core, and it's windows scheduler that decides where threads are executed.

 

Every thread in windows can be given an ideal processor value. FSX will set this for its main thread and the texture loaders based on the affinity mask setting in the .cfg, but the ideal processor value for the other threads will vary between each time you start FSX. You can check this with Process explorer. That thread can still get executed on any core even though an ideal processor has been set if windows finds it better at the time. This is what Microsoft themself says about it: "When you specify a thread ideal processor, the scheduler runs the thread on the specified processor when possible. Use the SetThreadIdealProcessor function to specify a preferred processor for a thread. This does not guarantee that the ideal processor will be chosen but provides a useful hint to the scheduler."

When it comes to FSX disk accessing thread this happens a lot. Even though an ideal processor has been set it still gets moved around to different cores but when the ideal processor value for it has been set to a vacant core at the startup of FSX it tends to stay there. When the ideal processor happens to be one that has a texture loader or the main thread on it the disk accessing thread very often executes on other cores than the specified ideal one. I have even very very rarely and temporary seen a texture loader execute on a core that was not assigned with FSX affinity mask.

 

As usual, we'd like the disk accessing thread (and all the debugging thread) not to execute on the same physical core as the main thread as that reduces FPS.

 

I only found out properly about the disk accessing thread and its varying ideal processor when I started using process explorer a few weeks ago. I haven't looked at the Dual core with hyperthreading case yet, but for my hexa core with hypertreading CPU it still tends to only choose between a few cores that it sets as ideal processor, therefore some affinity masks will work better than others.

 

I'm now thinking I've found the reason why AM=9 worked better than AM=5 when I tested this a lot a few years ago, but I haven't gone back and actually confirmed that's the reason. But I find it highly likely. AM=14 will generate a lot more CPU load with its extra texture loader and therefore fairly certainly push the other threads to the same physical core as the main thread, and reduce FPS as a result.

 

How busy this disk accessing core is, depends on what add-on sceneries you've got installed. I think that's probably why some affinity masks that really tries to utilize the CPU to the max work out for some, but not for others.

 

I hope it made some sense Dario.


Unfortunately I don't know of any way for us to set the ideal processor for any of  the other threads. The sound thread will restart and get a new ideal processor every time you go out of FSX window. The debug thread and the disk accessing thread get theirs assigned on FSX start-up.

Share this post


Link to post
Share on other sites

No, they are not locked to core 0. I know a lot of people thinks that windows processes or 'FSX fibers' are tied to core 0 but that is simply not the case. Window can always shedule threads to run at any cpu core, and it's windows scheduler that decides where threads are executed.

 

Every thread in windows can be given an ideal processor value. FSX will set this for its main thread and the texture loaders based on the affinity mask setting in the .cfg, but the ideal processor value for the other threads will vary between each time you start FSX. You can check this with Process explorer. That thread can still get executed on any core even though an ideal processor has been set if windows finds it better at the time. This is what Microsoft themself says about it: "When you specify a thread ideal processor, the scheduler runs the thread on the specified processor when possible. Use the SetThreadIdealProcessor function to specify a preferred processor for a thread. This does not guarantee that the ideal processor will be chosen but provides a useful hint to the scheduler."

When it comes to FSX disk accessing thread this happens a lot. Even though an ideal processor has been set it still gets moved around to different cores but when the ideal processor value for it has been set to a vacant core at the startup of FSX it tends to stay there. When the ideal processor happens to be one that has a texture loader or the main thread on it the disk accessing thread very often executes on other cores than the specified ideal one. I have even very very rarely and temporary seen a texture loader execute on a core that was not assigned with FSX affinity mask.

 

As usual, we'd like the disk accessing thread (and all the debugging thread) not to execute on the same physical core as the main thread as that reduces FPS.

 

I only found out properly about the disk accessing thread and its varying ideal processor when I started using process explorer a few weeks ago. I haven't looked at the Dual core with hyperthreading case yet, but for my hexa core with hypertreading CPU it still tends to only choose between a few cores that it sets as ideal processor, therefore some affinity masks will work better than others.

 

I'm now thinking I've found the reason why AM=9 worked better than AM=5 when I tested this a lot a few years ago, but I haven't gone back and actually confirmed that's the reason. But I find it highly likely. AM=14 will generate a lot more CPU load with its extra texture loader and therefore fairly certainly push the other threads to the same physical core as the main thread, and reduce FPS as a result.

 

How busy this disk accessing core is, depends on what add-on sceneries you've got installed. I think that's probably why some affinity masks that really tries to utilize the CPU to the max work out for some, but not for others.

 

I hope it made some sense Dario.

Unfortunately I don't know of any way for us to set the ideal processor for any of  the other threads. The sound thread will restart and get a new ideal processor every time you go out of FSX window. The debug thread and the disk accessing thread get theirs assigned on FSX start-up.

 

Yes, it makes sense thanks.

I assumed we were talking about fibers not threads. Fibers are scheduled by threads and I don't think PE shows any data for fibers.

I'm not sure if that scheduling of fibers also necessarily involves core affinity assignment or it can be left to the main scheduler and the thread only sets them to run / sleep

 

How do you figure out which thread is running in which core and what CPU load it has?

Share this post


Link to post
Share on other sites

 

 


Window can always shedule threads to run at any cpu core

 

then again, I'm pretty sure this is not correct. An app can force an affinity to threads (it's in the same page you linked).

I'm not saying this is the case for all FSX threads, unfortunately I don't have access to my FSX for testing now

Share this post


Link to post
Share on other sites

Hi,

 

Thank you very much for your help. I will try your value and see if any improvment. I will report back then.

 

Best regards,

 

Pierre

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this