mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   User activity feature request (https://www.mersenneforum.org/showthread.php?t=21265)

bgbeuning 2016-05-03 13:26

User activity feature request
 
Sometimes when my machine feels slow, I am tempted to turn off prime95 until
I am done using my machine. But then when I am done, I always forget to turn
prime95 back on.

There is a Windows API GetLastInputInfo() that tells a program when the last
user input (keyboard or mouse I think) happened.

[URL="https://msdn.microsoft.com/en-us/library/windows/desktop/ms646302%28v=vs.85%29.aspx"]https://msdn.microsoft.com/en-us/library/windows/desktop/ms646302%28v=vs.85%29.aspx[/URL]

My request is for something like this

While prime95 is running, every X seconds check for user input and if found suspend
While prime95 is suspended, every Y seconds check for user input and if none, then resume

I would set X at 15 to 30 seconds, and Y at 5 to 10 min.

This does not work when prime95 is a service. Or if two users are on one
machine using remote desktop. But I am OK with those restrictions.

Thanks,

kladner 2016-05-03 16:46

Are the applications you are stopping P95 for predictable enough that you could cover most needs with "PauseWhileRunning" and/or "LowMemWhileRunning"?

NBtarheel_33 2016-05-03 17:13

Prime95 is almost certainly *not* slowing down your computer. It is designed to run at the lowest priority, and will hence "get out of the way" of nearly any other task that needs to run. The only other possibility is that the priority settings of your Prime95 installation have been inappropriately raised, or Prime95 has been granted too much RAM for a P-1 assignment, causing repeated thrashing of the memory and hard disk.

I would check to be sure that you do not have a virus or malware that is potentially slowing down your system at certain intervals. Prime95 can actually be helpful here: if you watch your iteration times, and notice a jump every so many iterations (without your touching anything), this can be indicative of the presence of malware or viruses that are robbing spare CPU cycles.

kladner 2016-05-03 17:39

The one exception that I know of involves major Adobe apps like Photoshop and Lightroom. I don't think there is any real explanation, but things can slow down to where drawing the workspace is slow. Stopping a worker takes care of this.

rudi_m 2016-05-03 18:21

I'm using this, see undoc.txt (LINUX/FREEBSD/APPLE only):

In prime.txt you can have mprime suspend one worker when the system load gets above a threshold.
MaxLoad=a
MinLoad=b
PauseTime=c


[QUOTE=NBtarheel_33;433024]Prime95 is almost certainly *not* slowing down your computer.[/QUOTE]

This is not true. For a very simple test you can run two prime95 instances, one on high priority, one on low priority. I'm sure that the high priority instance is at least 5-10% slower while the low priority one is running. In some situations (hyperthreading CPU) the slow down will be more than 50% (similar as if both instances would run with the same priority).

bgbeuning 2016-05-03 19:30

measurements
 
I am a big proponent of taking measurements. So I timed one of my usual
tasks with and without prime95 running. The task is compiling a solution
in Visual Studio 2013 with about 90 projects.

Prime95 running (1st time) 25:20 (min:sec)
Prime95 not running 13:00
Prime95 running (2nd time) 24:00

I am not sure why there is such a difference given the scheduler priority
prime95 uses. My guess is the processes are kicking each others data
out of the L1/L2/L3 caches. The compile waits on lots of disk I/O. Every
time the compiler waits, prime95 runs and boots the compilers data out
of the caches.

The plan I suggested in the original post would not completely fix this compile
case because prime95 would start back up 10 minutes into the compile.

I could tell prime95 to look for the compiler (cl.exe & link.exe) running,
but this is just one example of what I use my PC for.

Task manager says the process Base Priority is Normal, but it does not
show the worker thread priority. I did not see thread priority in sysinternals
Process Explorer either. A second machine shows the same Base Priority.

The Linux I/O scheduler has a disk priority that says "only after no one else
has used the disk in X milliseconds". That would be a great OS priority to
have for the CPU also (prime95 can use the CPU after no other process has
run for X milliseconds).

TheJudger 2016-05-03 19:43

[QUOTE=NBtarheel_33;433024]Prime95 is almost certainly *not* slowing down your computer. It is designed to run at the lowest priority, and will hence "get out of the way" of nearly any other task that needs to run.[/QUOTE]

That is no longer true. This might be true on systems with just a single CPU core. But on a modern systems with e.g. a quadcore CPU Prime95 tries to utilize all 4 cores which is OK. When a user application needs CPU resources on just a single CPU core than it will get CPU time because of its (much) higher priority... BUT(!) the other cores are still running Prime95. This causes[LIST][*]all cores (3 cores Prime95 and 1 core user application) are [B]competing about shared resources[/B] like[LIST][*][B]memory bandwidth[/B][*]caches[*]thermal/power envelope (max turbo speed)[/LIST][*]unable to do max singlecore turbo on that CPU which runs the user application[*]...[/LIST]
Oliver

Dubslow 2016-05-03 21:38

[QUOTE=NBtarheel_33;433024]Prime95 is almost certainly *not* slowing down your computer. It is designed to run at the lowest priority, and will hence "get out of the way" of nearly any other task that needs to run. [/QUOTE]

Sorry, but this aint true. No common operating system I know of has a scheduler that's truly capable of idle-only scheduling. (At least, not Windows, Mac OS, or Linux. I know little about the *BSD kernels.)

Madpoo 2016-05-04 19:20

[QUOTE=TheJudger;433038]That is no longer true. This might be true on systems with just a single CPU core. But on a modern systems with e.g. a quadcore CPU Prime95 tries to utilize all 4 cores which is OK. When a user application needs CPU resources on just a single CPU core than it will get CPU time because of its (much) higher priority... BUT(!) the other cores are still running Prime95. This causes[LIST][*]all cores (3 cores Prime95 and 1 core user application) are [B]competing about shared resources[/B] like[LIST][*][B]memory bandwidth[/B][*]caches[*]thermal/power envelope (max turbo speed)[/LIST][*]unable to do max singlecore turbo on that CPU which runs the user application[*]...[/LIST]
Oliver[/QUOTE]

I've seen an instance here and there, pretty isolated and honestly I don't remember what it was, but I think it involved manipulating a large amount of files... it was kind of slow so I stopped Prime95 and it kicked into high gear.

George did explain in one post that if you have HT enabled, the OS will see all of these available "cores" and may not throttle back these idle-priority tasks. But if what you're doing is competing for resources that Prime95 is using (memory, AVX, whatever) you may find yourself in a situation where that idle-priority thread is still running full throttle on a core, leaving some other higher priority process waiting for resources.

I don't know if that fairly and accurately summarized what George said, so I beg pardon if I took it the wrong way.

For bgbeuning, I'd ask:
- Is hyperthreading enabled on your system?
- If so, could you disable in the BIOS and then try those VS compilations again to see if it's any different?

At the least, that would prove or disprove the idea that HT is playing any part in the OS giving too many cycles to an idle priority thread...

retina 2016-05-05 00:58

[QUOTE=NBtarheel_33;433024]Prime95 is almost certainly *not* slowing down your computer.[/QUOTE]Technically true, the computer won't go slower. But it will make other tasks run slower even at its lowest priority. All tasks have to share limited hardware resources, so things like the caches, memory controller paths, FPU/SEE/AVX registers, etc. need to be updated/saved/refreshed during each task switch. And programs that use lots of RAM and/or cache will experience slower operation when another task on another core is also using RAM and/or cache.

retina 2016-05-05 01:01

[QUOTE=Madpoo;433099]At the least, that would prove or disprove the idea that HT is playing any part in the OS giving too many cycles to an idle priority thread...[/QUOTE]This "idea" is already a known problem. The CPU doesn't have any method to introduce priority between threads. Two hardware threads on one core will share the same resources equally.


All times are UTC. The time now is 22:33.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.