From:	ADVAX::"mcnc!CUNYVM.CUNY.EDU!moeller%gwdgv1.dnet.gwdg.de" "GWDGV1::MOELLER" 16-MAY-1991 07:27:17.35
To:	ARISIA::EVERHART
CC:	
Subj:	RE: scheduler patches

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Thu, 16 May 91 07:25:54 EDT
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA21348 for ; Thu, 16 May 91 05:52:32 -0400
Received: from CUNYVM.CUNY.EDU by mcnc.mcnc.org (5.59/MCNC/3-21-91)
	id AA13828; Wed, 15 May 91 22:01:22 -0400
	for ARISIA.dnet.ge.com!EVERHART
Message-Id: <9105160201.AA13828@mcnc.mcnc.org>
Received: from DGOGWDG1.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.2.2MX) with BSMTP id 2794; Wed, 15 May 91 22:01:12 EDT
Received: from dnet.gwdg.de by DGOGWDG1.BITNET (Mailer R2.07) with BSMTP id
 6268; Thu, 16 May 91 04:00:12 MSZ
Date:    Thu, 16 May 1991 04:00:08 +0200
From: "GWDGV1::MOELLER" <mcnc!CUNYVM.CUNY.EDU!moeller%gwdgv1.dnet.gwdg.de>
To: ARISIA::EVERHART
Subject: RE: scheduler patches
 
> I would very much like to try your vms scheduler patches if you'll
> send me a copy. I'm running vms 5.4-2 so they will be directly
> useful. (*I* run quantum 2 here!)
> Thanks for the offer.
 
Glenn,
I wonder if it was a good idea to not post the patches this time -
I guessed it might make people more curious (no one appeared to care
for the patches I posted last year) - but now I have trouble answering ...
 
---
 
I used (user-)ECO numbers 105 and 101.
At least on a vector-uniprocessor you should not try 105 without 101
(although you might do something else in its place).
Of course, all reservations apply ...
 
	-wjm
 
PS. I'd expect that the effect of my patch is approx. proportional to the
value of QUANTUM :-) [Unless there is a bug!]
Let me know if you learn some new effect, so far I *only* noticed the
speedup of SPAWN. Processes communicating via mailboxes come to mind ...
 
 
$! ................... Cut between dotted lines and save. ...................
$!...........................................................................
$! VAX/VMS archive file created by VMS_SHARE V06.10 7-FEB-1989.
$!
$! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from
$! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au).
$!
$! To unpack, simply save, concatinate all parts into one file and
$! execute (@) that file.
$!
$! This archive was created by user MOELLER
$! on 16-MAY-1991 00:49:49.72.
$!
$! It contains the following 2 files:
$!        PROCESS_MANAGEMENT.ECO101
$!        PROCESS_MANAGEMENT.ECO105
$!
$!============================================================================
$ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL )
$ VERSION = F$GETSYI( "VERSION" )
$ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK
$ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", -
    "VMS_SHARE V06.10 7-FEB-1989 requires VMS V4.4 or higher."
$ EXIT 44 ! SS$_ABORT
$VERSION_OK:
$ GOTO START
$!
$UNPACK_FILE:
$ WRITE SYS$OUTPUT "Creating ''FILE_IS'"
$ DEFINE/USER_MODE SYS$OUTPUT NL:
$ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION -
    VMS_SHARE_DUMMY.DUMMY
b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) )
; s_file_spec := GET_INFO( COMMAND_LINE, "output_file" ); SET( OUTPUT_FILE
, b_part, s_file_spec ); b_errors := CREATE_BUFFER( "{Errors}" ); i_errors
:= 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN
& "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; POSITION
( BEGINNING_OF( b_part ) ); LOOP EXITIF SEARCH( SPAN( ' ' )@r_trail
& LINE_END, FORWARD) = 0; POSITION( r_trail ); ERASE( r_trail ); ENDLOOP
; POSITION( BEGINNING_OF( b_part ) ); i_append_line := 0; LOOP EXITIF MARK
( NONE ) = END_OF( b_part ); s_x := ERASE_CHARACTER( 1 )
; IF s_x = '+' THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip
<> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF
; ENDIF; IF s_x = '-' THEN r_skip := SEARCH( pat_end, FORWARD, EXACT )
; IF r_skip <> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip
:= MARK( NONE ); r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip
<> 0 THEN POSITION( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET )
; MOVE_VERTICAL( 1 ); MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part )
); ENDIF; ERASE( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF
; IF s_x = 'V' THEN s_x := ''; IF i_append_line <> 0 THEN APPEND_LINE
; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF; i_append_line := 1
; MOVE_VERTICAL( 1 ); ENDIF; IF s_x = 'X' THEN s_x := ''; IF i_append_line
<> 0 THEN APPEND_LINE; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF
; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> '' THEN i_errors
:= i_errors + 1; s_text := CURRENT_LINE; POSITION( b_errors ); COPY_TEXT
( "The following line could not be unpacked properly:" ); SPLIT_LINE
; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ); MOVE_VERTICAL
( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH
( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ); ERASE_CHARACTER( 1
); COPY_TEXT( ASCII( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDLOOP
; IF i_errors = 0 THEN SET( NO_WRITE, b_errors, ON ); ELSE POSITION
( BEGINNING_OF( b_errors ) ); COPY_TEXT( FAO
( "The following !UL errors were detected while unpacking !AS", i_errors
, s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" )
; ENDIF; EXIT;
$ DELETE VMS_SHARE_DUMMY.DUMMY;*
$ CHECKSUM 'FILE_IS
$ WRITE SYS$OUTPUT " CHECKSUM ", -
  F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!!,passed." )
$ RETURN
$!
$START:
$ FILE_IS = "PROCESS_MANAGEMENT.ECO101"
$ CHECKSUM_IS = 1064203476
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
XPROCESS_MANAGEMENT.EXE
X!
X!`009Patch to module RSE (SCH$QEND) ...
X!`009`009... in PROCESS_MANAGEMENT.EXE (VMS V5)
X!
X!`009w.j.m. may 1991
X!
X!`009Intention of this patch:
X!`009`009Do not give a vector consumer (at base priority)
X!`009`009a quantum different from other processes.
X!
X! This patch is valid for:
X!`009VMS 5.4,-1,-2
X!
X!
Xdefine CPB$C_VECTOR = 01
Xdefine PHD$W_QUANT = 0B0
Xdefine PCB$L_CAPABILITY = 012C
Xdefine PCB$B_PRI = 01C
Xdefine PCB$B_PRIB = 01D
X!
Xdefine RSE_nonpaged_data = 03AD0
Xdefine VP_QUANTUM = RSE_nonpaged_data + 3E
X!
Xdefine SCH$QEND_30$ = SCH$QEND - 068B + 06E1
Xdefine DETECT_MARGINAL_VP_CONSUMER = SCH$QEND - 068B + 903
X!
Xset eco 101
X!
Xverify/instr SCH$QEND - 068B + 6C7
X'bbc    #CPB$C_VECTOR,w`094PCB$L_CAPABILITY(r4),SCH$QEND_30$'
X'jsb    DETECT_MARGINAL_VP_CONSUMER'
X'cmpb   b`094PCB$B_PRI(r4),b`094PCB$B_PRIB(r4)'
X'bneq   SCH$QEND_30$'
X'mnegw  w`094VP_QUANTUM,w`094PHD$W_QUANT(r5)'
Xexit
X!
Xreplace/ins SCH$QEND - 068B + 06D8
X'bneq   SCH$QEND_30$'
Xexit
X'brb    SCH$QEND_30$'
Xexit
X!
Xupdate
X!
Xexit
$ GOSUB UNPACK_FILE
 
$ FILE_IS = "PROCESS_MANAGEMENT.ECO105"
$ CHECKSUM_IS = 509958982
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
XPROCESS_MANAGEMENT.EXE
X!
X!`009Patch to module SCHED (SCH$RESCHED) ...
X!`009`009... in PROCESS_MANAGEMENT.EXE (VMS V5)
X!
X!`009w.j.m. may 1991
X!
X!`009Intention of this patch:
X!`009`009Insert preempted processes at HEAD of priority queue
X!`009`009(instead of TAIL, as has always been done in VMS).
X!
X! This patch is valid for:
X!`009VMS 5.4,-1,-2
X!
X!
Xdefine`009IPL$_RESCHED = 03
Xdefine`009PR$_SIRR = 014`009`009! software interrupt request
X!
Xdefine`009PCB$L_STS2 = 028
Xdefine`009PCB$V_QUANTUM_RESCHED = 0
Xdefine`009PCB$M_QUANTUM_RESCHED = 1@PCB$V_QUANTUM_RESCHED
X!
Xdefine`009SCH$AQ_COMT = 080004974
Xdefine`009SCH$GL_IDLE_CPUS = 080004EC0
X!
Xdefine`009ECO105_9$ = SCH$RESCHED + 07A
X!
Xset eco 105
X!
Xverify/instr SCH$QEND-068B + 0773`009! bit is set here (also in EXE$RESCHED)
X'bisb2`009#PCB$M_QUANTUM_RESCHED,b`094PCB$L_STS2(r4)'
X'mtpr`009#IPL$_RESCHED,#PR$_SIRR'`009! (SOFTINT macro)
X'rsb'
Xexit
X!
Xverify/instr SCH$RESCHED + 06F
X'movaq`009@#SCH$AQ_COMT[r0],r2'
X'insque`009(r1),@(r2)+'
X'clrl`009@#SCH$GL_IDLE_CPUS'
Xexit
Xverify/instr ECO105_9$
X'clrl`009@#SCH$GL_IDLE_CPUS'
Xexit
X!
Xset patch PAT$A_NONPAGED
X!
Xreplace/ins SCH$RESCHED + 077
X'insque`009(r1),@(r2)+'
Xexit
V'bbcc`009#PCB$V_QUANTUM_RESCHED,b`094PCB$L_STS2(r1),ECO105_1$'`009! br if pre
Xempted
X'insque`009(r1),@(r2)+'`009`009`009! quantum end - insert at TAIL of queue
X'brw`009ECO105_9$'
V'ECO105_1$:`009insque`009(r1),b`094-4(r2)'`009! preempted - insert at HEAD of
X queue
X'brw`009ECO105_9$'
Xexit
X!
Xupdate
X!
Xexit
$ GOSUB UNPACK_FILE
$ EXIT
 
Wolfgang J. Moeller, GWDG, D-3400 Goettingen, F.R.Germany | Disclaimer ...
Bitnet/Earn: U0012@DGOGWDG5         Phone: +49 551 201516 | No claim intended!
Internet: Moeller@gwdgv1.dnet.gwdg.de   | This space intentionally left blank.
