From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: 1164f8,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.136.40 with SMTP id px8mr3772452pbb.1.1329400476866; Thu, 16 Feb 2012 05:54:36 -0800 (PST) Path: wr5ni31987pbc.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!newsfeed.utanet.at!newsfeed.tele2net.at!aioe.org!.POSTED!not-for-mail From: paramucho@hotmail.com (paramucho) Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Thu, 16 Feb 2012 13:54:22 GMT Organization: Aioe.org NNTP Server Message-ID: <4f3d06f0.6951576@nntp.aioe.org> References: <4f360d68.39000374@nntp.aioe.org> <4f396a03.27713593@nntp.aioe.org> <4f37ec05.63303162@nntp.aioe.org> <4f3a87d9.14307647@nntp.aioe.org> <4f3ca414.21534066@nntp.aioe.org> <4f3dab02.35785786@nntp.aioe.org> Reply-To: paramucho@hotmail.com NNTP-Posting-Host: CmgvwL3sOlojnxUjt8znzA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 1.5/32.451 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On Wed, 15 Feb 2012 18:12:33 +0100, Johnny Billquist wrote: >It is only a problem in kernel mode. And I've not yet seen anything that >convinces me that allowing page faults in kernel mode gains you >anything, but can cost you a lot. >What do you expect do to if you get a page fault in kernel mode? >Suspend the execution of something in kernel mode while the page is >being read in, in order to be able to restart the execution. This >becomes very messy, since this means you need to be able to suspend >execution at random places in the kernel. Nothing random about it at all. There are key points of contact with processes, each having it's own specific reason. At present I manage some of these contact points with MFPx/MFTx, in other places by mapping a kernel window. In either situation I will be able to choose if I want to lock a page in advance or not. It's not much more complicated than the current situation (where each point of contact is expected to care of unexpected errors anyway). >I simply does not think that is a good idea. >Instead having page faults possible in the kernel comes with other >costs, which are much higher, I think. We simply disagree on the issue of kernel page faults. >>> And as for "across the access", I'm not really fond of the Unix way of >>> having user processed get bogged down in the kernel and being preempted >>> and suspended in kernel mode. I prefer having all the service by the >>> kernel be finished immediately, and get back out to userland, and wait >>> there. So you need to be sure that what you are going to access is >>> available in the beginning, and after that, it will stay around until >>> your piece of service is finished. No additional checks. >Yes, system calls are handled in the kernel in RSX, and are run to >completion before normal scheduling can continue. However, all system >calls are really just performing one thing, which always is known to be >able to run from start to finish without blocking or having other >issues, so system calls never really block anything. System calls are at >the same level as forks, and of course you cannot allow two system >calls, or fork processes to run simultaneously, since that would mean >you get data corruption in the kernel. It was a great idea when RSX was very young and a simple multi-tasking system. As a grown-up general-purpose O/S I think the approach involves some serious limitations. While I'm certain that the earlier systm calls were in and out of the kernel pretty quickly I'm not sure that that's the case for a lot of the later directives. >> RT-11, RUST/XM and VMS control preemption entirely through >> mutexs/semaphores etc and system state. The kernel code which >> implements system calls for processes is just as preemptable as user >> mode code (and is reentrant). Anything less than that would seem >> pretty antiquated to me. > >RT-11 does no such thing. I remember having this discussion in the past >(with you?). Whenever any one program enters USR, all other calls will >be blocking until the first called exits USR again, and then one other >process can enter that whole thing. So only one program at a time can >for example create a file, or use the command line parser. I don't think your previous "discussion" was with me, or least I hope it wasn't, because the view you present is completely inaccurate. The "USR" is to RT-11 what the "F11ACP" is to RSX. You can't describe the scheduling dynamics of the RSX kernel on the basis of the F11ACP behavior and you can't describe RT-11's scheduling dynamics on the basis of the USR behavior. They're quite different things. The RT-11 USR is a sub-system which handles ACP-like services, driver fetch and the like. Access to the USR (ACP) is queued on a system-wide basis. I am not sure whether the RSX F11ACP is single-threaded for all devices or not. The RT-11 CSI (Command String Interpreter) was originally located in the USR. These days, in multi-tasking RT-11, initial CSI processing is handled outside the USR. Programs don't have to queue for command processing. >But to be clear, RSX protects the whole kernel through a lock, and does >not depend on system state or processor priority levels (apart from the >actual lock operations, which are using the IPL itself to protect them). >Which is why adding MP to RSX was also a rather simple operation. By "system state" I mean basically the same state as "fork state". In RSX that also involves a switch to the "system stack". System state runs at IPL 0. $DIRSV switches to system state. >RT-11 plays with the IPL at various places to protect code which is >sensitive. RT-11 uses IPL for hardware synchonisation in just the same way that RSX does. The fork routine is a good example. Here's the RSX code. $FORK0::MOV (SP)+,-(R4) ;SET FORK PC CLR -(R4) ;CLEAR LINK TO NEXT FORK BLOCK MFPS -(SP) ;SAVE CURRENT PROCESSOR PRIORITY MTPS #PR7 ;;;LOCK OUT INTERRUPTS MOV R4,@$FRKHD+2 ;;;LINK NEW ENTRY TO OLD LAST MOV R4,$FRKHD+2 ;;;SET ADDRESS OF NEW LAST MTPS (SP)+ ;;;RESTORE PROCESSOR PRIORITY And RT-11 implements some queue operations by blocking IPL briefly: MARKTM::TST (R5)+ ;Point to avail header SPL 7 ;Get element at PRIO 7 MOV @R5,R3 ;;; Get element BEQ 60$ ;;; None there, error MOV @R3,@R5 ;;; Link avail queue forward SPL 0 ;;; However, the primary tool that RT-11 uses for system (scheduler) synchronisation is ENSYS, which switches to system state (fork state). There are about twenty calls to $ENSYS in the resident monitor. The idea that RT-11 manages system synchronisation via IPL is simply wrong. System state and queues are used to manage synchronisation. >VMS is basically working the same way as RSX in most places, but adapted >to the different memory subsystem of the VAX. Which means you don't have >different address spaces for different modes. And of course, you have >paging, and there are some rather more synchronous services in there in >some places. When talking about system calls, I don't know how you can say that VMS works basically like RSX unless you can assert that VMS executes system calls, from start to finish, in system state (i.e. at fork level), and that's just not the case. Scheduling is not blocked for the duration of a VMS system calls as it is for an RSX system call. That's a fundamental difference. VMS and RT-11 take the same approach. Processing of a aystem service does not initially alter the process scheduling state. System state is used selectively, usually for short periods, when synchronisation is required. Further, both systems are reentrant: RT-11 and VMS system call code can issue system calls. RSX system call code cannot. The architecture of the RUST/XM kernel was based on a mixture of VMS and RT-11. There were few problems harmonising the two systems because they are fundamentally similar. Indeed, the system dynamics of RT-11, RUST/XM, RSX and VMS are constructed using the same building blocks. The principal difference is that RSX puts a system state wrapper around its system calls where the other systems do not. Ian