Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Johnny Billquist <bqt@softjar.se>
Subject: Re: PDP11 Values from MFPT
Date: Thu, 16 Feb 2012 21:15:55 +0100	[thread overview]
Message-ID: <jhjo5s$oga$1@Iltempo.Update.UU.SE> (raw)
In-Reply-To: <4f3d06f0.6951576@nntp.aioe.org>

On 2012-02-16 14.54, paramucho wrote:
> On Wed, 15 Feb 2012 18:12:33 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>> 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.
> <snip>
>> 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).

There are a whole bunch of them, though, and for different reasons, and 
under different conditions. You basically want to be able to handle page 
faults at those points. I prefer that the kernel does explicit control 
when it tries to do such stuff, and do it in advance. And then have a 
controlled behavior when/if memory is not paged in. You prefer to handle 
page faults in the kernel.

>> I simply does not think that is a good idea.
> <snip>
>> 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.

I'm perfectly fine with disagreeing on this then.

>>>> 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.
> <snip>
>
>> 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.

I can't really think of any system call that really need to sit in the 
kernel for extended periods. I really do think that is a bad idea, and 
that is what Unix prefers.

>>> 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.

I don't remember who it was with. Not important anyway.

> 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.

F11ACP is a process, scheduled just like any other process. And you are 
allowed to have as many of them as you want.

> 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.

It is hard to describe F11ACP in that way. First of all, you are allowed 
to have several F11ACP running, one for each device if you want to. 
Second, it is not really single-threaded as such. It is threading on a 
device level, though. You cannot have several opens or creates going on 
in parallel on a single device. The first file needs to be created 
before the second one can, for example (almost an obvious comment, but 
anyway...)
But you can have several creates being done on different devices at the 
same time.
The reason for wanting to have a separate F11ACP for your device is 
caching. F11ACP cache file headers, but there is only so much caching 
that can be done in one process. Having a separate process allows it to 
have a separate cache, since this cache is held in the process memory.

> 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.

Looking at the source, it would appear that anyone calling anything 
related to USR will lock everything else out from calling USR. I can see 
CSI in there, but it might be that some additional trickery is located 
somewhere.

But it's way more locking things out than RSX ever does. Not to mention 
that a process doing a call to open or create a file actually is not 
blocked in RSX. It can continue running happily on for ever before that 
call completes.

>> 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.

Ah. $DIRSV in RSX is the way you get to "system state" from a user mode 
system call. You can also get there through an interrupt, which then 
gets through $INTSI.
In reality, the "system state" is visible as the stack depth value. When 
it is 0, you are in system state. If it's +1 you are in user mode, and 
if it is <0, you are in an interrupt handler. Anything <1 means you are 
in kernel mode.
(You can also get there through $INTSC, $INTSE and $INTSV)

>> 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

The fork routine does not run with raised IPL. It's only the 
enquing/dequeing of the fork block that is protected by the IPL, just 
like I said. And that is also the part that have to have even more 
protection if you have an MP system, since even IPL will not protect you 
enough. I suspect you looked at 11M and not MP again here, right?
(Or else a rather old version of RSX.)

> 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		;;;

Yes. Exactly. And all of that kind of operations are in RSX done at the 
fork level, without IPL protection, because it is not needed.

That's what the forks are for. If RT-11 don't use forks for this, what 
do RT-11 use forks for?

> 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.

Yes, I can see a bunch of calls to ENSYS. And as far as I can tell, 
ENSYS raises the SPL to 7, before coming back to where it was invoked. 
Locking out all interrupts every time. Each routine can then, when it 
suitable, drop the IPL. There is also this FRK routine, which I assumed 
was how you created a fork in RT-11, but I might have missed something. 
The only thing calling FRK is SP.MAC, that I can see.

> The idea that RT-11 manages system synchronisation via IPL is simply
> wrong. System state and queues are used to manage synchronisation.

I obviously find it different when looking. ENSYS uses the IPL (always 
raising it to 7). Various functions like the mark time uses the IPL to 
protect structures. I didn't say "synchronization", but "protection". 
You can find it in lots of places, like I said.

>> 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.

What system calls does not complete immediately in VMS? Honestly asking 
since I don't know the answer myself, and cannot think of any straight 
off my head.

> 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.

Are you sure you are not mixing up the kernel with DCL, RMS and 
libraries in VMS here?

> 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.

VMS is very closely engineered like RSX in so many ways that I would 
find it odd if you could substantiate that it works more like RT-11. But 
I have been surprised before, and am ready for it again.

	Johnny


  reply	other threads:[~2012-02-16 20:15 UTC|newest]

Thread overview: 222+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 14:37 PDP11 Values from MFPT Jerome H. Fine
2012-01-18  6:03 ` paramucho
2012-01-18 11:28   ` Johnny Billquist
2012-01-18 13:05     ` glen herrmannsfeldt
2012-01-18 13:26       ` Johnny Billquist
2012-01-26  3:24         ` Jerome H. Fine
2012-01-26 13:38           ` Johnny Billquist
2012-01-29  1:32             ` Jerome H. Fine
2012-01-29  1:43               ` Johnny Billquist
2012-01-26  3:23       ` Jerome H. Fine
2012-01-18 16:02     ` paramucho
2012-01-18 18:12       ` Johnny Billquist
2012-01-19 14:30         ` paramucho
2012-01-19 16:42           ` Johnny Billquist
2012-01-19 20:32             ` glen herrmannsfeldt
2012-01-20 13:32               ` paramucho
2012-01-20 13:29             ` paramucho
2012-01-20 16:48               ` Johnny Billquist
2012-01-21 12:25                 ` paramucho
2012-01-21 20:15                   ` Johnny Billquist
2012-01-26  3:25               ` Jerome H. Fine
2012-01-26  6:09                 ` paramucho
2012-01-26  6:30                   ` paramucho
2012-01-26 13:50                     ` Johnny Billquist
2012-01-29  1:52                       ` Jerome H. Fine
2012-01-29  2:08                         ` Johnny Billquist
2012-01-26 13:48                   ` Johnny Billquist
2012-01-26 13:46                 ` Johnny Billquist
2012-01-29  1:35                   ` Jerome H. Fine
2012-01-18 12:41   ` glen herrmannsfeldt
2012-01-18 13:18     ` Johnny Billquist
2012-01-18 14:28       ` glen herrmannsfeldt
2012-01-18 15:14         ` Johnny Billquist
2012-01-18 21:54           ` glen herrmannsfeldt
2012-01-18 22:32             ` Al Kossow
2012-01-19  0:22             ` Johnny Billquist
2012-01-19  1:30               ` glen herrmannsfeldt
2012-01-19 14:32             ` Bob Koehler
2012-01-19 16:45               ` Johnny Billquist
2012-01-20 17:55                 ` Bob Koehler
2012-01-20 18:38                   ` Bill Gunshannon
2012-01-18 16:25       ` paramucho
2012-01-18 18:00         ` Johnny Billquist
2012-01-19 14:25           ` paramucho
2012-01-19 16:50             ` Johnny Billquist
2012-01-20 13:32               ` paramucho
2012-01-20 16:54                 ` Johnny Billquist
2012-01-21 13:16                   ` paramucho
2012-01-21 13:58                     ` Bob Eager
2012-01-21 20:02                     ` Johnny Billquist
2012-01-22 11:59                     ` Johnny Billquist
2012-01-22 14:03                       ` paramucho
2012-01-22 16:15                         ` Johnny Billquist
2012-01-23  4:14                           ` paramucho
2012-01-18 13:20     ` Bob Eager
2012-01-19 14:29       ` Bob Koehler
2012-01-21 12:44   ` Tim Shoppa
2012-01-21 13:50     ` paramucho
2012-01-22 16:56       ` Tim Shoppa
2012-01-22 18:11         ` glen herrmannsfeldt
2012-01-23  3:52         ` paramucho
2012-01-21 14:25     ` glen herrmannsfeldt
2012-01-21 16:46       ` Bob Eager
2012-01-25 22:12       ` Tim Shoppa
2012-01-26  3:22   ` Jerome H. Fine
2012-01-26 13:46     ` paramucho
2012-01-29  1:34       ` Jerome H. Fine
2012-01-29 15:46         ` paramucho
2012-02-01  3:53           ` Jerome H. Fine
2012-02-01 11:22             ` paramucho
2012-02-01 11:48               ` Johnny Billquist
2012-02-01 13:48                 ` paramucho
2012-02-01 14:43                   ` stan
2012-02-01 16:37                     ` paramucho
2012-02-01 18:05                       ` stan
2012-02-02  2:24                       ` Jerome H. Fine
2012-02-02  0:14                   ` Johnny Billquist
2012-02-02  2:25                     ` Jerome H. Fine
2012-02-02  9:29                       ` Johnny Billquist
2012-02-02 18:52                         ` glen herrmannsfeldt
2012-02-03  0:12                           ` Johnny Billquist
2012-02-03  4:07                           ` Jerome H. Fine
2012-02-03 14:15                             ` Johnny Billquist
2012-02-03 15:00                         ` paramucho
2012-02-02 13:31                     ` paramucho
2012-02-02 19:07                       ` glen herrmannsfeldt
2012-02-03  0:16                         ` Johnny Billquist
2012-02-03  4:23                           ` glen herrmannsfeldt
2012-02-03 12:01                             ` Johnny Billquist
2012-02-03 15:36                           ` Joe Oswald
2012-02-07 10:46                             ` Johnny Billquist
2012-02-03  4:29                         ` Jerome H. Fine
2012-02-03 12:50                           ` Bill Gunshannon
2012-02-04  8:42                             ` Charles Richmond
2012-02-04 13:38                               ` paramucho
2012-02-04 16:03                                 ` Bill Gunshannon
2012-02-04 16:39                                   ` paramucho
2012-02-03 10:48                         ` paramucho
2012-02-03 11:24                       ` Johnny Billquist
2012-02-04 17:06                         ` paramucho
2012-02-04 18:22                           ` paramucho
2012-02-04 18:55                             ` Johnny Billquist
2012-02-04 19:13                               ` Bill Gunshannon
2012-02-05 13:28                                 ` Johnny Billquist
2012-02-05 18:15                                   ` glen herrmannsfeldt
2012-02-04 18:51                           ` Johnny Billquist
2012-02-04 23:09                             ` glen herrmannsfeldt
2012-02-05 14:01                               ` paramucho
2012-02-05 15:31                                 ` Johnny Billquist
2012-02-06 13:50                                   ` paramucho
2012-02-06 14:45                                     ` Johnny Billquist
2012-02-06 14:58                                       ` paramucho
2012-02-06 16:25                                         ` Johnny Billquist
2012-02-05 14:27                               ` Johnny Billquist
2012-02-05 13:57                             ` paramucho
2012-02-05 15:44                               ` Johnny Billquist
2012-02-06 13:51                                 ` paramucho
2012-02-06 14:56                                   ` Johnny Billquist
2012-02-06 16:40                                     ` Johnny Billquist
2012-02-07 14:50                                       ` paramucho
2012-02-07 16:20                                         ` Johnny Billquist
2012-02-08 13:34                                           ` paramucho
2012-02-08 16:03                                             ` Johnny Billquist
2012-02-08 16:58                                               ` paramucho
2012-02-08 22:29                                                 ` Johnny Billquist
2012-02-10 13:12                                                   ` paramucho
2012-02-10 19:20                                                     ` glen herrmannsfeldt
2012-02-11 13:12                                                       ` paramucho
2012-02-11 20:06                                                         ` glen herrmannsfeldt
2012-02-11 20:23                                                         ` Johnny Billquist
2012-02-10 19:29                                                     ` Johnny Billquist
2012-02-11 13:15                                                       ` paramucho
2012-02-11 21:09                                                         ` Johnny Billquist
2012-02-12 17:23                                                           ` paramucho
2012-02-12 18:35                                                             ` paramucho
2012-02-13 17:30                                                               ` paramucho
2012-02-14 13:14                                                               ` Johnny Billquist
2012-02-14 16:20                                                                 ` paramucho
2012-02-14 17:30                                                                   ` Johnny Billquist
2012-02-13 23:18                                                             ` Johnny Billquist
2012-02-14 16:20                                                               ` paramucho
2012-02-14 17:47                                                                 ` Johnny Billquist
2012-02-14 18:17                                                                   ` paramucho
2012-02-14 19:54                                                                     ` Johnny Billquist
2012-02-15 12:58                                                                       ` paramucho
2012-02-15 17:12                                                                         ` Johnny Billquist
2012-02-16 13:54                                                                           ` paramucho
2012-02-16 20:15                                                                             ` Johnny Billquist [this message]
2012-02-17 12:41                                                                               ` paramucho
2012-02-17 17:13                                                                                 ` Johnny Billquist
2012-02-18 11:24                                                                                   ` Johnny Billquist
2012-02-18 14:28                                                                                     ` paramucho
2012-02-18 20:07                                                                                       ` Johnny Billquist
2012-02-18 11:55                                                                                   ` paramucho
2012-02-18 20:58                                                                                     ` Johnny Billquist
2012-02-20  2:29                                                                                       ` Jerome H. Fine
2012-02-20  5:54                                                                                         ` paramucho
2012-02-20 17:14                                                                                           ` Jerome H. Fine
2012-02-20 18:05                                                                                             ` Johnny Billquist
2012-02-21  6:16                                                                                               ` paramucho
2012-02-21 17:38                                                                                               ` Jerome H. Fine
2012-02-21 19:31                                                                                                 ` Johnny Billquist
2012-02-20  5:53                                                                                       ` paramucho
2012-02-20 10:28                                                                                         ` Johnny Billquist
2012-02-21  3:33                                                                                           ` Jerome H. Fine
2012-02-21  6:17                                                                                           ` paramucho
2012-02-21 10:23                                                                                             ` Johnny Billquist
2012-02-21 11:37                                                                                               ` paramucho
2012-02-21 14:16                                                                                                 ` Johnny Billquist
2012-02-21 16:42                                                                                                   ` paramucho
2012-02-21 19:43                                                                                                     ` Johnny Billquist
2012-02-22 12:21                                                                                                       ` paramucho
2012-02-22 14:12                                                                                                         ` paramucho
2012-02-22 15:26                                                                                                         ` Johnny Billquist
2012-02-22 14:33                                                                                                       ` paramucho
2012-02-22 15:53                                                                                                         ` Johnny Billquist
2012-02-22 16:48                                                                                                           ` paramucho
2012-02-22 21:17                                                                                                             ` Johnny Billquist
2012-02-23 12:42                                                                                                               ` paramucho
2012-02-23 13:51                                                                                                                 ` paramucho
2012-02-23 15:17                                                                                                                 ` Johnny Billquist
2012-02-20  2:22                                                                                   ` Jerome H. Fine
2012-02-20  6:07                                                                                     ` paramucho
2012-02-21  3:29                                                                                       ` Jerome H. Fine
2012-02-21  8:06                                                                                         ` paramucho
2012-02-21 10:38                                                                                           ` Johnny Billquist
2012-02-21 11:54                                                                                             ` paramucho
2012-02-21 14:20                                                                                               ` Johnny Billquist
2012-02-21 15:13                                                                                                 ` paramucho
2012-02-21 15:20                                                                                                   ` Johnny Billquist
2012-02-22  2:51                                                                                           ` Jerome H. Fine
2012-02-22  6:37                                                                                             ` paramucho
2012-01-18 11:20 ` Johnny Billquist
2012-01-26  3:21   ` Jerome H. Fine
2012-01-26 14:12     ` Johnny Billquist
2012-01-26 15:26       ` paramucho
2012-01-29  1:41         ` Jerome H. Fine
2012-01-29  2:04           ` Johnny Billquist
2012-01-29  2:31             ` Johnny Billquist
2012-01-29  1:39       ` Jerome H. Fine
2012-01-29  1:45         ` Johnny Billquist
2012-01-30  2:21 ` Bob Supnik
2012-01-31  7:14   ` paramucho
2012-01-31  9:42     ` Johnny Billquist
2012-01-31 14:24       ` Bill Gunshannon
2012-01-31 20:17         ` Johnny Billquist
2012-01-31 21:39           ` Bill Gunshannon
2012-01-31 23:43             ` glen herrmannsfeldt
2012-02-01  3:56             ` Jerome H. Fine
2012-02-01 11:53               ` Johnny Billquist
2012-02-01 13:48                 ` paramucho
2012-02-02  0:20                   ` Johnny Billquist
2012-02-02  2:22                 ` Jerome H. Fine
2012-02-01 12:14             ` Johnny Billquist
2012-02-01 16:27               ` glen herrmannsfeldt
2012-02-01  5:28         ` Charles Richmond
2012-02-01 11:54           ` Johnny Billquist
2012-02-01  3:55       ` Jerome H. Fine
2012-02-01 11:22       ` paramucho
2012-02-01 12:03         ` Johnny Billquist
2012-02-01  3:54   ` Jerome H. Fine
2012-02-01 12:09     ` Johnny Billquist
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox