flat assembler
Message board for the users of flat assembler.

Index > Heap > HT, on or off?

Author
Thread Post new topic Reply to topic
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
http://blogs.amd.com/work/2010/01/21/it%E2%80%99s-all-about-the-cores/

Seeing as it's coming from AMD(who doesn't have HT), I see a pretty good reason to take a negative opinion about HT from them with a grain of salt.

Hyper-threading causes capacity planning and monitoring challenges, and as a result, the expected gain in CPU overhead is likely not justified. Hyper-threading should be disabled by default for production Exchange servers and only enabled if absolutely necessary as a temporary measure to increase CPU capacity until additional hardware can be obtained.
Is the cache trashing really and that other stuff mentioned above so detrimental as to turn off HT?

Is it really worth buying Intel(-based computers)? I've always seen HT as the reason to buy Intel, but if it really doesn't help that much, then I'll probably by a cheaper AMD.

In general, is Intel's superiority over AMD proportionate to how much more Intel costs than AMD, IYO?
Post 18 Jul 2010, 02:18
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17260
Location: In your JS exploiting you and your system
revolution
It depends upon what you are doing, as always. No one rule will suit all usage situations.

The only major flaw I've found with HT is the inability to prioritise the two threads. Using a low priority thread mixed with a high priority thread running together on a single HTed core will effectively make them the same priority. For heavy computational tasks at a low priority I would suggest to turn off HT just so as to get back the priority separation and keep the system responsive to user input.
Post 18 Jul 2010, 02:29
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Does the clock speed of an HT cpu mean the speed each thread runs at, or the thread that happens to be running at an instance?

> turn off HT just so as to get back the priority separation and keep the system responsive to user input.
Imagine a RT OS on a HT cpu. That could get really confusing.
Post 18 Jul 2010, 02:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17260
Location: In your JS exploiting you and your system
revolution
Tyler wrote:
Does the clock speed of an HT cpu mean the speed each thread runs at, or the thread that happens to be running at an instance?
The clock speed is the speed of the core. The two threads share a single core. HT is designed to take advantage of otherwise free functional units from one thread and fill them with operations from the other thread. If you get more than 5% increase in throughput with HT enabled then consider yourself extremely lucky. Wink
Post 18 Jul 2010, 02:45
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
So you get cores*2 running at speed/2, not so useful for some HT processors. The i7-720QM(the cpu in a lappy I'm considering buying, but am unsure as to whether to but Intel or AMD) runs at 1.6ghz with 4 cores. I wouldn't even consider buying a processor with 8+ cores if each ran at 800mhz.
Post 18 Jul 2010, 03:08
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17260
Location: In your JS exploiting you and your system
revolution
It doesn't divide the speed by two. It is not so precise as that. If one of the virtual processors in a HTed core has no thread to run, or is blocked waiting for something, then it consumes zero cycles and the other thread uses the full CPU speed.
Post 18 Jul 2010, 03:12
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Is it possible for an OS to know what 2 pseudo-cores use the same physical core? That would make monitoring core usage at least kinda possible and would allow the OS to prioritize whether or not both pseudo-cores should be used.
Post 18 Jul 2010, 03:22
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17260
Location: In your JS exploiting you and your system
revolution
Tyler wrote:
So you get cores*2 running at speed/2, not so useful for some HT processors. The i7-720QM(the cpu in a lappy I'm considering buying, but am unsure as to whether to but Intel or AMD) runs at 1.6ghz with 4 cores. I wouldn't even consider buying a processor with 8+ cores if each ran at 800mhz.
Actually, now that we know the reason for your enquiry, I would suggest that you are focussing upon the wrong criterium. Perhaps instead you should be looking at power efficiency? AMD has always struggled to get the power usage down in laptops so you might find that an Intel CPU can suit the laptop usage situation better. HT is a red-herring.
Post 18 Jul 2010, 03:24
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17260
Location: In your JS exploiting you and your system
revolution
Tyler wrote:
Is it possible for an OS to know what 2 pseudo-cores use the same physical core? That would make monitoring core usage at least kinda possible and would allow the OS to prioritize whether or not both pseudo-cores should be used.
The OS can and does know about the HT/cores/sockets arrangement. But that doesn't help. Software cannot override the HTs lack of prioritisation. It is a hardware limitation.
Post 18 Jul 2010, 03:27
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
If the OS can tell if 2 threads are running on the same core, it would be simple to make the scheduler only schedule both threads when doing so is optimal, otherwise it could leave one blocked. I'm assuming switching isn't done unless both are scheduled.
Post 18 Jul 2010, 03:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17260
Location: In your JS exploiting you and your system
revolution
Tyler wrote:
If the OS can tell if 2 threads are running on the same core, it would be simple to make the scheduler only schedule both threads when doing so is optimal, otherwise it could leave one blocked. I'm assuming switching isn't done unless both are scheduled.
Simple? Hmm. Scheduling is a very hard problem. There are oodles of thesis/scientific papers written on scheduler optimisation. See my rant also.
Post 18 Jul 2010, 03:45
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Surely any scheduler must be aware of which (pseudo-)cores are available and which are not. When it is sub optimal to use both pseudo-cores, mark one pseudo-core of each core as being unavailable, and when conditions reverse, mark them available. Also, one would want a way to wait it out when a core is running 2 threads. This could be done by having an HT_disabled boolean variable, when it is set, any pseudo-core on a formerly dually used core that becomes blocked is left blocked and set to unavailable.

One negative effect I see that this would cause, is a little overhead for the logic to determine whether HT should be "disabled". The question is: whether or not that overhead is worth it for the gain. If I were to implement it in a kernel of my making, I think I would make the inclusion/use of the checking function a compile time configuration option.
Post 18 Jul 2010, 09:50
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
revolution wrote:
Actually, now that we know the reason for your inquiry
You make me sound so... selfish Smile. That wasn't the whole reason, but only part. Embarassed I'm always interested in the acquisition of knowledge.

Intel vs. AMD - Is HT worth $70? It actually matters for me. I'm working on earning the money for one of them now. I have $456 of $849 or $929. I know, I'm counting my eggs before they hatch, but it gives me a reason to work harder. Deciding on what I want gives me a clear target on what to strive for, and a reason not to spend my money on something stupid(Believe me, I can waste $$$ QUICKLY.). It's like the proverbial light at the end of the tunnel for me. To give you an idea, I've been saving since Christmas Smile. I do manual labor for my grandpa and neighbor(1 of 2 that could have been connecting to my wireless. Laughing Luckily, I listened to you and didn't do anything.), it's not that the don't pay well, it's that the work is few and far in between.
Post 18 Jul 2010, 10:56
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Tyler wrote:
Surely any scheduler must be aware of which (pseudo-)cores are available and which are not. When it is sub optimal to use both pseudo-cores, mark one pseudo-core of each core as being unavailable, and when conditions reverse, mark them available. Also, one would want a way to wait it out when a core is running 2 threads. This could be done by having an HT_disabled boolean variable, when it is set, any pseudo-core on a formerly dually used core that becomes blocked is left blocked and set to unavailable.

One negative effect I see that this would cause, is a little overhead for the logic to determine whether HT should be "disabled". The question is: whether or not that overhead is worth it for the gain. If I were to implement it in a kernel of my making, I think I would make the inclusion/use of the checking function a compile time configuration option.
So would it work, or is there something I'm missing?
Post 19 Jul 2010, 04:54
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17260
Location: In your JS exploiting you and your system
revolution
Tyler wrote:
So would it work, or is there something I'm missing?
Probably something you are missing. Although I'm not really qualified to answer, because I have never been involved in schedulers of general purpose OSes.

To my unexpert and untrained eye it appears as though you would mostly cancel any chance to ever run the cores in HT mode for any normal usage scenario. Plus, something you need to consider is the the OS can't know in advance how long a thread wants to run. If it is only for a brief period then stopping and starting other threads to accommodate one brief run of a higher priority thread seems quite drastic. Also, it might be that some users want to have higher throughput and are prepared to live with slower responsiveness to get it.
Post 19 Jul 2010, 05:54
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Speed increase from use of HyperThreading depends a lot on the application in question - see this table, for instance. WinRAR got a ~15% speed boost, Fritz 11 got ~24%. A few apps went slightly slower.
Post 19 Jul 2010, 08:00
View user's profile Send private message Visit poster's website Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 692
Location: Adelaide
sinsi
Intel themselves say 10-30% speedup with HT.
Microsoft have had problems with SQL Server when a worker thread and a memory-intensive thread run on HT, because the memory thread causes cache thrashing (since the L1/L2/L3 cache is shared).
In some instances they got a 30% increase by disabling HT.
Post 19 Jul 2010, 08:27
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Update even though it is way off topic, and I never should have brought it up in this thread:

I got the $800 one(Phenom II X4 1.6, 4GB DDR3, 500GB 5400rpm, ATI Radeon HD 4250(Integrated Sad, but it has 1 free ExpressCard slot.), 16in 1366x768, BACK-LIT KEYBOARD Shocked) for $650(new) from Amazon. The fact I got it for $150 less made the decision a lot easier. I've read some reviews(I'm waiting for it to be delivered.) and they're kinda giving me buyer's remorse with all their talk about slow single threaded apps on the Phenom II X4 1.6, but too late now... Smile But there's single core processors that fast, surely that couldn't be possible if single threaded apps are slow at 1.6. As long as GTA IV runs smoothly, I'll be happy.
Post 28 Jul 2010, 15:30
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.