CPU Affinity with HyperThreading

Started by rdsu, July 22, 2013, 05:20:16 AM

Previous topic - Next topic

rdsu

Hi,

I would like to know how reliable are the settings for CPU Affinity with HyperThreading?

On web we have some contradictory explanations, like this one, about how to identify each Core and their physical/logical CPU's...

Do you have some documentation that can support your "HyperThreaded Core Avoidance" method?

Thanks for your support!

Best Regards

BenYeeHua

Just click on the "HyperThreaded Core Avoidance" and you will see it choose only the Core 0, 2, 4, 6. ;)

rdsu

Quote from: BenYeeHua on July 22, 2013, 10:40:19 AM
Just click on the "HyperThreaded Core Avoidance" and you will see it choose only the Core 0, 2, 4, 6. ;)
I saw that, but their isn't any explanation about why you decided this way...

Is this the only possible way to determine Core's and CPU's?

If I set through Task Manager will be the same order?

Core1: CPU0 physical core, CPU1 logical core
Core2: CPU2 physical core, CPU3 logical core
.
.
.

?

Jeremy Collake

#3
First, to make sure it's clear, that BenYeeHua is not the author of Process Lasso, so *he* didn't decide ;). He posts often, and is very helpful, so I fear people may get confused. I suppose it doesn't matter anyway.

The CPUs are numbered in a static way. Their index number becomes their unique identifier. There's no other mapping, so you can't re-arrange them. You could disable cores, but they still end up sequential, and paired cores (HyperThreaded or Bulldozer+) are always adjacent to one another. There's no way to confuse the issue, no matter what you do, or with what software.

The answer to your question is: Yes, they will always be at the same indices, with the Windows Task Manager or Process Lasso. The Hyper-Threaded Core Avoidance setting is disabled for systems that don't have that, or a similar, technology.
Software Engineer. Bitsum LLC.

rdsu

Can you share some official source from Microsoft, Intel or AMD?

Jeremy Collake

I don't know of any off-hand.

It's not a question that's asked often because what I stated above is true.

If there were any way to map a CPU to a different index, then it would come up more often.

Of course, I am speaking of Windows only. In theory, alternate operating systems could allow remapping of CPU indexes. However, I don't know of any that do, or any reason why someone would want to.
Software Engineer. Bitsum LLC.


Jeremy Collake

That discussion is about VMWare's hypervisor, and how virtual machines handle Hyper-Threading (they don't, since their CPUs are fake), but it reiterates what I've said above.

And do note that cores within a virtual machine are not even real CPUs. They can have their time slices executed all over the place (many different cores) on the host. That's why HT isn't available within virtual machines, and Process Lasso recognizes that.
Software Engineer. Bitsum LLC.

BenYeeHua

And it is very easy to testing it, just run a benchmark software, choose as 2 threads, compare the score for Core 0, 2 and Core 0, 1.
I can very sure that Core 0, 2 is the highest score, and you will know that core 1, 3 are the fake-core.

And yes, as Windows is design like that, so you will not found the core has been changed place, and why it should changing it? ;)

rdsu

Official Support & BenYeeHua,

Did you also read the two answers of "RParker" user, on that topic, about the new Hyper-Threading Technology?

BenYeeHua

#10
You should know that it is my time to sleep when I am replying it. ;)
So the answer is no.
----I think this is Off-Topic already.
There are some contradictory.
QuoteThe Hyper-Threading implementation does ensure that one hardware thread would not be starved.
QuoteFinally, one last thing to note is that you can still run single-threaded applications on a platform with Hyper-Threading enabled. Intel® Hyper-Threading is designed to not reduce the performance of single-threaded applications.
Really?
Then we must running 2 difference single-threaded software (that has been optimized not too bad) on the same core, difference HT threads, and see the performance reducing. ;D
----
But anyways, I know that 2 threads coming from 1 core are HT threads, so there are the same shared hardware, but I wonder that if the os moving the software main thread between this 2 threads will causing some overhead or not...
And the most strange thing is, someone that using Process Lasso report to me, he get FPS increase after setting like this...

I think it can be the processing time reduced for the 2 threads that running on the same core, difference HT threads.
So the second thread move directly to the second core, not staying on the same core in a short time.

As Windows Scheduler will put some thread on the second HT thread, and move quickly to the other core threads if it got the chance.

But I think that, if we set the CPU affinity to difference core(core 0, core 2), then we make sure the process threads will only moving between 2 core, not 2 core, 4 threads, and you decrease the chance to put the heavy processing thread on the same core, biting the other heavy processing thread that also on the same core.
----
Bingo~ ;)
http://forums.anandtech.com/showthread.php?t=2332380

Jeremy Collake

Yes, I did. He is saying the exact same thing as I am. Exactly. That virtual machines end up executed on any core on the host, as their CPUs are not actual CPUs.. they are emulated, or rather virtualized. It doesn't apply to anything other than virtual machines, btw.

And just ignore the 'old' hyperthreading he references. He shouldn't have even mentioned it. It's not relevant, not the same technology as what you know of as HyperThreading, not what we're talking about here, and not a concern.

I believe these answers are absolute. I am starting to feel a little questioned here. However, everyone is telling you the same thing, here and at the VMware boards.
Software Engineer. Bitsum LLC.

rdsu

I just wanted to know, nothing more... ;)

Thanks!!!