Null process / idle loop

Everything you want to talk about that doesn't fit to other categories.
User avatar

Topic author
martin
Valued Contributor
Posts: 73
Joined: Tue Mar 22, 2022 6:47 pm
Reputation: 0
Location: England
Status: Offline

Null process / idle loop

Post by martin » Fri Jun 09, 2023 10:25 am

Curiosity only - low priority!

Years ago I did the VAX/VMS internals courses and I still have the documentation for the course, dated around 1987/8. The other day I was running OpenVMS 9.2 as a VM when I noticed that with nothing to do the host saw <1% CPU usage. I have 4 cores, and had 2 allocated to VMS at the time. I remembered back over the decades and thought that the VMS scheduler never really stopped, it just sat in a tight loop (not quite a spinlock) waiting for something to be available. Sure enough:

Code: Select all

60$:	TSTL	G^SCH$GL_COMQS		; POSSIBLY READY TO DO SOMETHING?
	BNEQ	20$			; YES, TRY AGAIN
	BEQL	60$			; NO, KEEP LOOKING
Now clearly internals have changed radically over 5 major versions and 4 architectures! So just to satisfy my idle curiosity, how does the VM release unused CPU back to the host whilst still being responsive to interrupts from scheduling events and device drivers?
Martin
  • Retired System Manager: VMS/UNIX/UNICOS/Linux.
  • Started on a VAX 11/782 in 1984 with VMS 3.6.

User avatar

Topic author
martin
Valued Contributor
Posts: 73
Joined: Tue Mar 22, 2022 6:47 pm
Reputation: 0
Location: England
Status: Offline

Re: Null process / idle loop

Post by martin » Thu Oct 26, 2023 9:39 am

Many thanks all for your continuing comments. As I said, it was just a matter of curiosity for an old-timer who did the VAX/VMS Internals on version 4.4. Halting the processor was pretty final on 1980s bare metal hardware, halting an emulator is clearly a lighter weight issue. If I may wonder further: I see that Pocketprobe is (unofficially) installing VMS directly onto x86 hardware (viewtopic.php?f=21&t=8621), presumably having an idle loop there using up spare cycles won't be an issue?
Martin
  • Retired System Manager: VMS/UNIX/UNICOS/Linux.
  • Started on a VAX 11/782 in 1984 with VMS 3.6.

User avatar

volkerhalle
Master
Posts: 198
Joined: Fri Aug 14, 2020 11:31 am
Reputation: 0
Status: Offline

Re: Null process / idle loop

Post by volkerhalle » Sun Oct 29, 2023 3:45 am

The Stromasys CHARON-AXP emulator uses the Alpha WTINT PALcode instruction (in the special SYS$IDLE execlet - installed by the Stromasys IDLE kit).
From Alpha ARM (Architecture Reference Manual pg. II-A 2-94):

The WTINT instruction requests that, if possible, the PALcode wait for the first of either of the following conditions before returning:

- Any interrupt other than a clock tick
- The first clock tick after a specified number of clock ticks has been skipped
Volker.


gdwnldsksc
Active Contributor
Posts: 28
Joined: Sat Apr 22, 2023 3:56 am
Reputation: 0
Status: Offline

Re: Null process / idle loop

Post by gdwnldsksc » Wed Nov 15, 2023 6:16 am

martinv wrote:
Thu Oct 26, 2023 8:13 am
Camiel could know that - he wrote an Alpha emulator (ES40, forked as AXPbox, and AFAIK the basis for Avanti/FreeAXP).
I would hope not! That would be a massive GPL violation ..... that, and Virtual alpha was around in 2006, before es40's code history relates to it being written.

Post Reply