F11ACP TUNING ON RSX11M+

Frank Penner
System Programmer
G. D. Searle & Co.

14-SEP-83

The RSX11M+ V2.0 distribution kit includes two F11ACP build command
files.  The file FCPLRGBLD.CMD includes comments describing optimal
values for the configurable psect extensions, but no guidelines for
how large the values can be before the F11ACP breaks.  Of particular
interest is psect $$AFR1, which is used for FCBs, and psect $$BUF3,
which is used for directory buffers.  Fortunately, the distribution kit
includes the F11ACP sources (thank you DEC). 

The F11ACP maps itself with user APR 7, therefore the F11ACP can be
12K.  The F11ACP at times does a $SWSTK to map with kernel APRs.  Such
code and data cannot be mapped with APR 7.  All such code, with the
exception of module TRUNC, is psect $CODE1.  All the data comes before
the code.  Therefore it turns out that the two psects, $$AFR1 and
$$BUF3 can be extended until the F11ACP is 12K.  There is one other 
restriction, module ARWVB tweaks kernel APR 6, therefore, it must be 
mapped with APR 5.  One solution would be to change the module's psect 
name.  I simply modified it to tweak APR 5, so it could be mapped with 
APR 6.  I also removed the check of symbol .ARWVB in module INIT.  
The maximum size of the two psects, $$AFR1 and $$BUF3, can be 21754 octal 
bytes.

For more buffer space, it is possible to build an I and D space
F11ACP.  All that is required is to insert a /ID switch in the TKB
command line on the task image.  One code change is required.  Modules
MXQIO and MOUNT1 contain code that has embedded data.  This must be
changed. 

Module MXQIO old:
	$BEGIN	MXQIO,<Execute QIO for mount>

;
; COPYRIGHT (c)	1982 BY DIGITAL EQUIPMENT CORPORATION.
; ALL RIGHTS RESERVED.
;
; THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED
; OR COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;

	$VERSION	0204

;
; PREVIOUSLY MODIFIED:
;	ANDREW C. GOLDSTEIN
;
; MODIFIED:
;
;	M. PETTENGILL	1-NOV-80
;		MLP023 -- MOUNT INTERFACE CHANGES
;
;	M. Pettengill	11-Feb-1982
;		MLP070 - Allow building as multi-user task
;
;

	$CODE2                                                          ; MLP070

	.MCALL	DIR$,WSIG$S

;+
;
; *** .MXQIO - QIO CALL ROUTINE
;
; THIS ROUTINE EXECUTES THE SPECIFIED DPB (ASSUMED TO BE A QIO AND
; WAIT) AND TESTS FOR ERRORS.
;
; CALL:	JSR	R5,XQIO
;	.WORD	DPB ADDRESS
;
; REGISTERS ARE PRESERVED.
;
;-

.MXQIO::
	DIR$	(R5)+		; DO IT
	BCC	20$		; DIRECTIVE OK
	CMP	$DSW,#IE.UPN	; CHECK FOR NO NODES
	BNE	10$		; SOMETHING ELSE - GIVE UP
	WSIG$S			; WAIT A BIT
	TST	-(R5)		; BACK UP R5
	BR	.MXQIO		; AND TRY AGAIN

10$:	MOV	$DSW,.QIOST	; PUT ERROR CODE IN STANDARD PLACE
20$:	TSTB	.QIOST		; CHECK FOR I/O ERROR
	BGT	30$		; OK
	SEC			; MINUS MEANS ERROR
30$:	RTS	R5

;
;
	$END	MXQIO
;
;
	.END

Module MXQIO new:
	$BEGIN	MXQIO,<Execute QIO for mount>

;
; COPYRIGHT (c)	1982 BY DIGITAL EQUIPMENT CORPORATION.
; ALL RIGHTS RESERVED.
;
; THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED
; OR COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;

	$VERSION	0204

;
; PREVIOUSLY MODIFIED:
;	ANDREW C. GOLDSTEIN
;
; MODIFIED:
;
;	M. PETTENGILL	1-NOV-80
;		MLP023 -- MOUNT INTERFACE CHANGES
;
;	M. Pettengill	11-Feb-1982
;		MLP070 - Allow building as multi-user task
;
;	F. Penner 10-AUG-83 
;		allow building with I and D space
;

	$CODE2                                                          ; MLP070

	.MCALL	DIR$,WSIG$S

;+
;
; *** .MXQIO - QIO CALL ROUTINE
;
; THIS ROUTINE EXECUTES THE SPECIFIED DPB (ASSUMED TO BE A QIO AND
; WAIT) AND TESTS FOR ERRORS.
;
;old way:
; CALL:	JSR	R5,XQIO
;	.WORD	DPB ADDRESS
;
;new way (FP I and D):
;	MOV	R5,-(SP)
;	MOV	#DPB,R5
;	JSR	PC,.MXQIO
;	MOV	(SP)+,R5
;
;
; REGISTERS ARE PRESERVED.
;
;-

.MXQIO::
	DIR$	R5		; DO IT
	BCC	20$		; DIRECTIVE OK
	CMP	$DSW,#IE.UPN	; CHECK FOR NO NODES
	BNE	10$		; SOMETHING ELSE - GIVE UP
	WSIG$S			; WAIT A BIT
	BR	.MXQIO		; AND TRY AGAIN

10$:	MOV	$DSW,.QIOST	; PUT ERROR CODE IN STANDARD PLACE
20$:	TSTB	.QIOST		; CHECK FOR I/O ERROR
	BGT	30$		; OK
	SEC			; MINUS MEANS ERROR
30$:	RTS	PC

;
;
	$END	MXQIO
;
;
	.END


Module MOUNT1 must have:

.MACRO	QIO	DPB
	JSR	R5,.MXQIO
	.WORD	DPB
.ENDM	QIO

changed like so:

.MACRO	QIO	DPB
	MOV	R5,-(SP)
	MOV	#DPB,R5
	JSR	PC,.MXQIO
	MOV	(SP)+,R5
.ENDM	QIO


The maximum size of the two psects, $$AFR1 and $$BUF3, can be 50300 octal 
bytes.  The only problem I have noticed is that the task display of 
RMD doesn't output correct file information with my I and D space 
F11ACP.

Here is a comparison chart of different configurations I have run.  I 
have a user with 1000 files and a 32 block directory file.  I also 
have more than 40 users on the same disk, each with a seperate 
directory, hence, I run a LRU of 50.  I have as many as 130 FCBs for 
that disk.

F11ACP   $$AFR1 psect       FCBs    $$BUF3 psect      Directory    F11ACP size
flavor   size octal bytes   number  size octal bytes  blocks       in words
------   ----------------   ------  ----------------  ---------    -----------

FCPLRG     3000              34        3000              4           9216
(standard DEC)

maximized  744               11        21000             18          12256
for directory blocks

D space    12240             120       37000             32          18080
