Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!amdcad!weitek!weaver From: weaver Newsgroups: comp.arch Subject: Re: VAX and VMS development (was Re: Graphics Primitives) Message-ID: <1990Nov26.172817.20055@weitek.COM> Date: 26 Nov 90 17:28:17 GMT References: <11030@pt.cs.cmu.edu> <42992@mips.mips.COM> <513@ctycal.UUCP> <1990Nov21.191759.23254@Think.COM> Sender: weaver@weitek.COM (mike weaver) Reply-To: weaver@weitek.UUCP (Michael Weaver) Organization: WEITEK Corp. Sunnyvale Ca. Lines: 52 It has been a while since I learned about VAX/VMS, but here is what I remember about architectural support for VMS by VAX: 1. Atomic enqueue/dequeue instructions are used for queuing IO requests. 2. The famous complex CALLG and CALLS call instructions use a certain stack frame layout, which is used in signal handling. 3. Software interrupts (Asynchronous System Traps) are like signals, but handled by hardware as if they were interrupts in an attempt to integrate interrupt and signal handling. 4. Branch-on-low bit is used frequently because the returned status from each system call is encoded with the least signifigant bit signifying success or failure, and other bits uniquely identifying the error. None of these would seem to have been radical at the time, but they do seem to be architectural support specifically for VMS. The handling of page faults in VMS has been described incorrectly a few times in comp.arch, so I will attempt to get it right. The VAX has a dirty bit in the MMU, but does not have a referenced bit. The textbook approach to page replacement is called the clock algorithm. This works like a meter maid: I mark a page as not used, wait a while, and if it is not marked as used (referenced) when I look at it again, it is a candidate for replacement. Usually, the marking of pages as referenced is supported by hardware. The VMS version works as follows: when I need a page that is not in memory, I pick a page *at random* from my working set (per process pool of memory), and put it in one of two long lists of pages, one for dirty and one for clean. Then I take the last page in the list of clean pages, and use that block of memory as my new page. (The dirty list is being written back to disk asynchronously, and when a page is written back it also transferred to the clean list). If the page I need is actually in the clean or dirty list, a simple swap is made. In this case, the mapping for the needed page is still in the page tables, so finding it is fairly efficient. The net effect is similar to the clock algorithm in that pages that have not been used for a long time will most likely to be put to backing store. It would be interesting to hear from any developers of the VAX why this was done this way. It is hard to believe that the designers of the VAX had not heard of a referenced bit. It is possible that the simplification of hardware was considered a plus, but this goes against the grain of the rest of the design. I would guess the the VMS developers thought they had a superior implementation of working sets, and having committed to it, told the VAX developers not to bother with a referenced bit.