![]() |
Problem with HT processor
Hi!
I have noticed a problem with HyperThreading P4 processor. The problem is that Prime95 slows down my system. If I run many programs then this is not a problem as Windows distributes them over (two virtual) CPUs and then because Prime95 has the lowest priority everything works as it should (that is Prime95 does not get many CPU cycles). The problem is if I want to run only one program (next to Prime95 in background). Then because Windows XP thinks I have a dual CPU system it "gives" one CPU to the Prime95 and the other one to my other program. So each of the programs uses 100 % of their CPU. But because those are not real CPUs my program slows down as Prime95 is quite heavy on numerical part of the (physical) CPU. And because I run many numerically intensive programs this means that my programs run at around 50 % of the speed they would run without Prime95 running. I know this is not the problem in Prime95 itself but I would like to point out this exception to the statement I found stressed many times in a readme file and Prime95 pages that Prime95 uses only idle cycles and does not slow down other programs as it runs under the lowest priority. And because HT processors are quite common nowdays I would suggest that Prime95 should correct this (somehow). If there is a way to do this, of course. Because very often the user is running only one program intensively and if this program is running at 50 % of normal speed... Mike |
Simple Answer
Turn of hyperthreading in bios its really quite useless i mean for what they push it as its not. Noting can do what they claimed it can do all it can do is get you around 30 precent performance and if your proc has HT then its not even worth that 30 because its broken up and its rather hard to get 30% best off go to bios and disable it. |
Some have reported that setting prime95's affinity to CPU 0 will solve the problem.
The problem you describe is, in my opinion, an OS bug. It should not assign a normal priority and an idle priority thread to run together on a hyperthreaded CPU. Worse yet, there are no OS calls that I've found to detect this condition and pause prime95. |
[QUOTE]The problem you describe is, in my opinion, an OS bug. It should not assign a normal priority and an idle priority thread to run together on a hyperthreaded CPU. Worse yet, there are no OS calls that I've found to detect this condition and pause prime95.[/QUOTE]
Bummer, I would have thought a SwitchToThread API might help. I doubt it, but here is the description anyway. The SwitchToThread function causes the calling thread to yield execution to another thread that is ready to run on the current processor. The operating system selects the thread to yield to. Private Declare Function SwitchToThread Lib "kernel32.dll" () As Long Private Sub Form_Load() SwitchToThread End Sub |
Check this thread, two solutions.
[url]http://www.mersenneforum.org/showthread.php?t=3746[/url] HT P4 with media player was running poorly with Prime95.exe running. Setting the CPU affinity in Prime95.exe to 0 allowed media player to run well. The other solution is adding lines to prime.ini PauseWhileRunning=program.exe PauseCheckInterval=20 The above means check every 20 seconds to see if program.exe is running if so pause Prime95.exe |
I think, another source of this problem is, that the 2 threads running simultaneously on a HT CPU simply have the same priority. The CPU doesn't manage different priorities. The OS only manages timeslices and if it sees an idle virtual CPU it even sends an idle priority thread to it, disturbing a high priority thread on the other virtual CPU. If the CPU affinity of Prime95 is set to 0, I think following happens: the Prime95 thread can only be sent to virtual CPU #0, while the other demanding thread is hopping from one virtual CPU to another because it doesn't have such an affinity setting. So it simply hinders Prime95 to run in 50% of the time, thus it effectively reduces the amount of time where ressources are occupied by Prime95 and so it finally has more CPU ressources for itself.
Although 2 demanding threads run smoothly on a HT CPU they still occupy the same hardware ressources as we already know. They seem to run smooth because the threads are "switched" with instruction granularity and not xy ms. |
Could a sudden increase in iteration time be taken as an indicator that the system is otherwise busy and that Prime95 should be paused temporarily?
Alex |
[QUOTE=akruppa]Could a sudden increase in iteration time be taken as an indicator that the system is otherwise busy and that Prime95 should be paused temporarily?
Alex[/QUOTE]The increased iteration time already shows, that Prime95 is at least getting less ressources than usual. But if the performance of the other apps is OK for you, I don't see a reason, why Prime95 should be made even slower. |
I found a nice post on the Intel software forum regarding HT performance:
[url]http://softwareforums.intel.com/ids/board/message?board.id=42&message.id=548[/url] The answer from the Intel guy also includes some details on how the L1 is shared between these threads (a thing I heard but never got confirmed somewhere). So the logical processors only get half the L1 cache (even if a thread uses only a few bytes of it). So the pure existence of a second thread (always the case if SMT is activated and supported by the OS) could possibly reduce performance of an application optimized for 8kB L1 on Northwood or 16kB L1 on Prescott. |
[QUOTE=Prime95]Some have reported that setting prime95's affinity to CPU 0 will solve the problem.[/QUOTE]
This does not work. Prime95 then runs on CPU 0, but the other program jumps to CPU 1 and there is no difference. They both keep running with full priority on their CPU and so my program slows down. |
[QUOTE=Dresdenboy]So the pure existence of a second thread (always the case if SMT is activated and supported by the OS) could possibly reduce performance of an application optimized for 8kB L1 on Northwood or 16kB L1 on Prescott.[/QUOTE]
Does this affect Prime95 perfomance? Is Prime95 optimized for different L1 cache sizes? OT: Does P4 HT processor reports half of the L1 cache when running in HT mode? So the solution for my problem would probably be that Prime95 would have a setting which would tell what is the lowest iteration time under which it would run. If the iteration time fails bellow this limit Prime95 should pause. I do not think that this would be so hard to implement. But it would really be nice to have. Because I really cannot afford to have programs running at 50 % of their speed. |
[QUOTE=mimic]This does not work. Prime95 then runs on CPU 0, but the other program jumps to CPU 1 and there is no difference. They both keep running with full priority on their CPU and so my program slows down.[/QUOTE]You could try to get better results by reducing Prime95's process priority (in the Options menu - unlock with password '9876' and change the priority) and/or use the task manager and increase the priority of the other task's process (right click on the process and change priority).
|
I presume Prime95 is already running at idle priority, unless mimic changed the default setting (and then he'd obviously already know about the priority option). If the OS sees an idle cpu, it'll run Prime95 on it, no matter what its priority is. The problem is that the OS does not know that processes on both virtual cpus compete for execution units in the same core.
Alex |
[QUOTE=akruppa]If the OS sees an idle cpu, it'll run Prime95 on it, no matter what its priority is. The problem is that the OS does not know that processes on both virtual cpus compete for execution units in the same core.[/QUOTE]I wrote the same ~8 postings above :wink:
But you are right about the possibly unchanged priority setting. If it is a certain application, which is disturbed that much by Prime95, then the user could also stop it quickly in the system tray. |
Based on a lot of recent testing I have found that Windows XP and 2000 are very brain dead when it comes to Hyperthreading (as you have found out).
Linux 2.4 is the same way, but the Linux 2.6 kernel knows about HT and schedules processes based on the fact that the second "processor" is just a virtual one. Much better performance seen with 2.6. |
What flavor of 2.6 are you running?
|
Another option to reduce the CPU time used by Prime95
In prime.ini put the following line Throttle=n where n = milliseconds to sleep after each iteration. Try =1000 Unfortunately this will hobble Prime95 all the time, because it isn't connected to the PauseWhileRunning. Maybe a ThrottleWhileRunning would be appropriate. Was the PauseWhileRunning=program1,program2 tried ? It will effectively keep Prime95 from taking CPU time/FP resources from the other program. What about with a small number (for more frequent checking) of the associated line ? PauseCheckInterval=4 Does Affinity 1 for Prime95 make any difference ? Are both virtual CPUs treated identically or is one just given time if the primary is waiting/is stalled ? |
[QUOTE=dsouza123]Does Affinity 1 for Prime95 make any difference ?
Are both virtual CPUs treated identically or is one just given time if the primary is waiting/is stalled ?[/QUOTE]The virtual CPUs are treated identically by the Windows scheduler and AFAIK the virtual CPUs themselves have equal priority. I agree with you about using the throttle parameter. This should at least improve the situation. |
[QUOTE=PhilF]What flavor of 2.6 are you running?[/QUOTE]
What do you mean by flavour? I am using the generic kernel from kernel.org (not any patch set version). The version I tested was 2.6.10 or possibly the latest 2.6.11. |
[QUOTE=Dresdenboy]I agree with you about using the throttle parameter. This should at least improve the situation.[/QUOTE]
This sadly does not work for me. The problem is in overall speed for programs I use everyday. So then Prime95 would not get any CPU time as I am running the programs almost always. But even if they run they do not consume CPU all the time (in fact they consume the CPU only in fraction of their runtime - but I would like that in this fraction they work fast). Of course I can pause the Prime95 every time ... but ... :-) |
Interesting. I wonder why setting the Prime95 affinity to 0 fixed my Media Player issue. I double checked the results before I posted them. It really did work and I made sure there were no other variables in the testing.
I didn't test any other programs because I don't have a problem with any others. My computer is very fast whether I have 1 program or 10 open. I am using Win XP Pro SP2 and my P4 is a 530. According to CPU-Z it is Family F, Ext. Family 0, Model 3, Ext. Model 0, Stepping 4, Revision D0. I thought of another possibility if you are having problems with a specific program. You could try setting Prime95 affinity to 0 from within Prime95 like I did. Then from the Processes tab of the Windows Task Manager you can set the affinity of the program you are having trouble with to only use CPU 0. Then there is no way it can jump to CPU 1. This is just a thought. I have never tried this because just setting the Prime95 affinity worked for me. |
why dont you disable HT and try from there it will be a option in ur bios...
|
For just one program like real player, could you set the affinity of both Prime95 and real player to the same CPU, and then run real player at a higher priority?.
If it is just a temporary measure until MS fixes its scheduler to recognise hyperthreads, it seems a pity to have to put the work-around into the Prime95 code. |
| All times are UTC. The time now is 23:31. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.