English Amiga Board


Go Back   English Amiga Board > Support > support.AmigaOS

 
 
Thread Tools
Old 27 November 2021, 15:41   #1
Torti-the-Smurf
Registered User
 
Torti-the-Smurf's Avatar
 
Join Date: Dec 2018
Location: Earth
Posts: 1,058
CPU usage in Idle Workbench

Hi Folks
I was wondering, why the CPU usage in an idle Workbench is so High.

You see, i was looking at Dopus Cpu usage Gauge and i was wondering why it was changing,
without doing anything

It was always changing, from 14% to 18 to 38% and then repeat the same loop.

So, i did download PerfMonitor

https://aminet.net/package/util/moni/PerfMonitor

and it showed me that the Input.Device needs a lot of Cpu usage.
Even the wait for the Trackdisk.device needs a few Procent.

But the results are completly different from DOpus.

The Tool System Idle
https://aminet.net/package/dev/src/SystemIdle10

on the other hand, showed 99-100% free Cpu. ?

Now, i am really confused. Maybe you can help me out ?

1) Is it normal that the Input Device needs that much Cpu ?

2) Are those tests even real ? (Dopus Cpu, PrefMonitor, SystemIdle, ect.)

3) If they are, why are they conflicting each other in the results ?

4) If the Input.device really needs that much Cpu, why dosent multitask (OS friendly) Apps/games suffer.

Hmmm, i dont understand these results ....; a confused, Torti
Attached Thumbnails
Click image for larger version

Name:	Cpu-Usage-Idle.jpg
Views:	116
Size:	438.1 KB
ID:	73937   Click image for larger version

Name:	Free-Cpu.jpg
Views:	99
Size:	298.4 KB
ID:	73938  
Torti-the-Smurf is offline  
Old 27 November 2021, 16:18   #2
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
It may be that the software that does the measurement itself takes important amount of cpu.
As input.device is the context GUI is normally handled, as long as you need to draw something -- it will take its toll.
In short, this kind of measurement isn't reliable.
But you could see how much is taken by just creating and running some program whose instruction timing is known and measures its own speed, then compare the result with the counted clocks (i dunno if i'm clear here ).
meynaf is offline  
Old 27 November 2021, 23:40   #3
Torti-the-Smurf
Registered User
 
Torti-the-Smurf's Avatar
 
Join Date: Dec 2018
Location: Earth
Posts: 1,058
Sounds Complicated; at least for a baked Smurf like me

Those Cpu Monitors report pretty much always the same results.
(dosent matter if real Hardware or Emulated.

68020 or 68060 Cpu ..... dosent make a difference

Weird
Torti-the-Smurf is offline  
Old 08 December 2021, 08:33   #4
Bruce Abbott
Registered User
 
Bruce Abbott's Avatar
 
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
Quote:
Originally Posted by Torti-the-Smurf View Post
So, i did download PerfMonitor

https://aminet.net/package/util/moni/PerfMonitor

and it showed me that the Input.Device needs a lot of Cpu usage.
Even the wait for the Trackdisk.device needs a few Procent.
Only 'ready' tasks use a lot a lot of CPU time. These are tasks that want to run when a timeslice is available.

Tasks that are 'waiting' use almost no CPU time. These tasks don't get any CPU time unless something they are waiting for becomes active.

Quote:
1) Is it normal that the Input Device needs that much Cpu ?
It doesn't. It shows 83% 'waiting' because it has a higher priority and is always waiting for something.

Tally up all the 'waiting' percentages and you will get close to 100%. That doesn't mean the CPU is being used during that time. On the Amiga the CPU doesn't just 'spin its heels' when no tasks need it, it actually goes into an idle state while waiting for the task scheduling (or any other) interrupt. It does this using the 'STOP' instruction, which halts the CPU until an interrupt occurs. This reduces system power consumption because there is no CPU bus activity, and also significantly reduces CPU power consumption on CMOS CPUs.

Quote:
2) Are those tests even real ? (Dopus Cpu, PrefMonitor, SystemIdle, ect.)
I'm betting Dopus isn't 'real' if it shows high CPU usage.

Quote:
3) If they are, why are they conflicting each other in the results ?
Because some are badly implemented?

Quote:
4) If the Input.device really needs that much Cpu, why dosent multitask (OS friendly) Apps/games suffer.
It doesn't is why.
Bruce Abbott is offline  
Old 08 December 2021, 09:56   #5
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by Bruce Abbott View Post
On the Amiga the CPU doesn't just 'spin its heels' when no tasks need it, it actually goes into an idle state while waiting for the task scheduling (or any other) interrupt. It does this using the 'STOP' instruction, which halts the CPU until an interrupt occurs.
Do you have any evidence on this? I've never before heard that amiga os doesn't just "waste" idle cycles while waiting for something to do.
hooverphonique is offline  
Old 08 December 2021, 10:30   #6
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by hooverphonique View Post
I've never before heard that amiga os doesn't just "waste" idle cycles while waiting for something to do.
Just run an emulator with speed set to max : host cpu will not go 100% if emulated cpu doesn't.

If you want more concrete proof, here is idle loop from rom 39.106 (A1200) :
Code:
00f8138e: move.w #$2700,sr
00f81392: movea.l (a0),a3
00f81394: move.l (a3),d0
00f81396: bne.s $f813a8
00f81398: addq.l #1,$118(a6)
00f8139c: bset #7,$124(a6)
00f813a2: stop #$2000
00f813a6: bra.s $f8138e
Note the STOP instruction.
meynaf is offline  
Old 08 December 2021, 11:14   #7
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by meynaf View Post
Just run an emulator with speed set to max : host cpu will not go 100% if emulated cpu doesn't.

If you want more concrete proof, here is idle loop from rom 39.106 (A1200) :
Code:
00f8138e: move.w #$2700,sr
00f81392: movea.l (a0),a3
00f81394: move.l (a3),d0
00f81396: bne.s $f813a8
00f81398: addq.l #1,$118(a6)
00f8139c: bset #7,$124(a6)
00f813a2: stop #$2000
00f813a6: bra.s $f8138e
Note the STOP instruction.
Thanks
So the emulator will suspend the native emulator process when emulating the STOP instruction (or something along those lines) - interesting...
hooverphonique is offline  
Old 08 December 2021, 11:22   #8
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by hooverphonique View Post
So the emulator will suspend the native emulator process when emulating the STOP instruction (or something along those lines) - interesting...
This is linked to the "CPU Idle" setting in Winuae properties pages. I don't know how it works exactly, it is possible this has no effect if "Fastest possible" isn't ticked.
meynaf is offline  
Old 08 December 2021, 11:28   #9
grond
Registered User
 
Join Date: Jun 2015
Location: Germany
Posts: 1,918
The interesting thing about this is that it took the Windows NT branch until the early 2000s (?) to add such a simple feature.
grond is offline  
Old 08 December 2021, 19:57   #10
Torti-the-Smurf
Registered User
 
Torti-the-Smurf's Avatar
 
Join Date: Dec 2018
Location: Earth
Posts: 1,058
Really interestig stuff. Thanks for all the feedback so far
Torti-the-Smurf is offline  
Old 24 December 2021, 16:00   #11
Michael
A1260T/PPC/BV/SCSI/NET
 
Michael's Avatar
 
Join Date: Jan 2013
Location: Moscow / Russia
Posts: 839
In general CPU usage should be very low, unless you have some 'devils' running in the background that do something, even if you don't see it.
It could be a busy signal from one of the devices that causes problems..



PS: The DOpus5 CPU meter is a simple approach to the problem, that does not do justice most of the time untill there is some real load. Use something more dedicated if you really wish to see how cpu usage varies.
Like above, small spikes are windows moved.
Attached Thumbnails
Click image for larger version

Name:	cpu-usage.png
Views:	246
Size:	5.7 KB
ID:	74193  
Michael is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
change cpu idle from within emulation honx support.WinUAE 9 25 May 2019 15:31
Sound glitches with CPU Idle(?) hexaae support.WinUAE 70 05 July 2018 14:54
WinUAE utilization CPU Idle AMIGASYSTEM support.WinUAE 1 13 April 2018 13:03
CPU Idle works good with 68020 CE Leandro Jardim support.WinUAE 1 30 April 2014 18:15
Help with 'CPU Idle' slider in WinUAE antonvaltaz support.WinUAE 18 14 September 2009 16:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:10.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11959 seconds with 14 queries