From: SMTP%"DSJ@WKUVX1.WKU.EDU" 21-DEC-1993 10:52:09.46 To: EVERHART CC: Subj: OCTOBER93.SPFFRG X-FileServer: Digital Systems Journal File Server Date: Tue, 21 Dec 1993 09:55:10 CDT Sender: DSJ-Mgr@WKUVX1.WKU.EDU Errors-To: DSJ-Mgr@WKUVX1.WKU.EDU Warnings-To: <> From: DSJ-Mgr@WKUVX1.WKU.EDU Reply-To: DSJ@WKUVX1.WKU.EDU Subject: OCTOBER93.SPFFRG To: EVERHART@arisia.gce.com $mac sptfrag $link sptfrag == $ run sptfrag Total SPTEs : 137216 Free SPTEs : 11562 Chunks : 30 Ave. Chunk size : 385 Top 32 SPTE Chunks. 11486 8 5 4 4 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 0 0 $ == $ run sptfrag Total SPTEs : 2077952 Free SPTEs : 654865 Chunks : 37 Ave. Chunk size : 17699 Top 32 SPTE Chunks. 654638 49 34 29 15 12 9 8 6 6 6 4 4 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 1 1 1 == ***************************************************************************** File SPTFRAG.MAR follows ***************************************************************************** .title sptfrag .ident 'X01-001' ;++ ; ; Facility: System Page Table usage statistics ; ; Abstract: ; This is the SPTFRAG utility. ; ; Author: ; Lee K. Gleason N5ZMR (the fragmentation guy) 19-MAY-1993 ; Control-G Consultants ; 1734 Wakefield ; Houston TX 77018 ; Phone 713/681-3985 ; gleason@mwk.com ; ; Functional Description: ; ; This program will tell you how many free SPTEs you have, ; in how many "chunks", and give you a notion how big the chunks ; are. ; ; This program uses kernel mode, high IPL and spinlocks. Use ; at your own risk. ; ;-- .link "sys$system:sys.stb"/SELECTIVE_SEARCH .library "sys$library:lib.mlb" $ssdef ;system status defs numchunks = 32 ;number of chunks to report on ;if you change this, change the FAO control string. assume numchunks gt 1 ;it won't work if 1 or 0 .psect sptpur pic,long,usr,con,rel,gbl,shr,noexe,rd,nowrt,novec faostr: .ascid ~!/Total SPTEs : !8UL!/~- ~Free SPTEs : !8UL!/~- ~Chunks : !8UL!/~- ~Ave. Chunk size : !8UL!/~- ~!/~- ~ Top 32 SPTE Chunks.!/~- ~!8UL !8UL !8UL !8UL !8UL !8UL !8UL !8UL!/~- ~!8UL !8UL !8UL !8UL !8UL !8UL !8UL !8UL!/~- ~!8UL !8UL !8UL !8UL !8UL !8UL !8UL !8UL!/~- ~!8UL !8UL !8UL !8UL !8UL !8UL !8UL !8UL!/~ .psect sptdat pic,long,usr,con,rel,gbl,noshr,noexe,rd,wrt,novec outlen = 1024 outstr: .long outlen .address outbuf outbuf: .blkb outlen ;***************************************************** ; Do not rearrange following lines...I'm warning you! beglock: totspt: .long 0 ;total number of SPTEs free: .long 0 ;number of free spte's count: .long 0 ;number of chunks ave: .long 0 ;average chunk len, more or less fragarr:.blkl numchunks ;array of top n chunks. endlock: ; Do not rearrange preceding lines...you'll be sorry! ;***************************************************** ; address range of data to be accessed at high ipl. dlockrange: .long beglock .long endlock ;address range of code to run at high ipl. clockrange: .long do_spt .long endspt .psect sptcod pic,long,usr,con,rel,gbl,shr,exe,rd,nowrt,novec .entry sptfrag,^m~~> $lkwset_s inadr = dlockrange ;lock the data down blbc r0,666$ $lkwset_s inadr = clockrange ;lock the code down blbc r0,666$ $cmkrnl_s routin = do_spt ;when I move my head... blbc r0,666$ ;...hit it! divl3 count,free,ave ;get average value (more or less) $faol_s ctrstr = faostr,- ;format the results attractively outbuf = outstr,- outlen = outstr,- prmlst = beglock ;items in the argument list blbc r0,666$ pushal outstr calls #1,g^lib$put_output 666$: ret .entry do_spt,^m~~r2,r3,r4,r5,r6,r7,r8,r9,r10,r11> lock lockname = MMG ;lock memory management activity movl @#mmg$gl_sptlen,totspt ;how many, altogether? movl @#mmg$gl_sptbase,r2 ;addr of the sptes to r2 movl @#ldr$gl_free_pt,r3 ;offset of longwords or bytes... ;...to 1st chunk cmpl #^X00010001,@#SYS$GL_VERSION+20 ;sysgen version cell blss 1$ ;if 5.3 (1.1) or less, use byte index movab (r2)[r3],r3 ;calc addr of 1st free spte, byte index brb loopy 1$: moval (r2)[r3],r3 ;calc addr of 1st free spte, long index loopy: movl #1,r5 ;assume it's one SPTE long bitl #^X200000,(r3) ;then check bneq single ;if not, skip getting size longword movl 4(r3),r5 ;put size in r5 single: bsbw domax ;do the max. recording subroutine addl r5,free ;add to number of free SPTEs incl count ;in one chunk tstl (r3) ;was it the last one? beql getback ;if so, land the star cruiser bicl3 #^X200000,(r3),r4 ;mask off single flag if present cmpl #^X00010001,@#SYS$GL_VERSION+20 ;sysgen version cell blss 1$ ;if 5.3 or less, use longword index movab (r2)[r4],r3 ;get offset to next using byte index brb loopy ;Spinning wheel, got to go 'round 1$: moval (r2)[r4],r3 ;get next offset using longword index brb loopy ;when I get to the bottom... ;...I go back to the top of the slide getback: unlock lockname = MMG,- ;release our hold newipl = #0,- ;old IPL condition = RESTORE ;but, only our access of it movl #1,r0 ret domax: movl #~~numchunks-1>,r7 ;number of entries, less 1 moval fragarr,r8 ;address of max length array moval ~~numchunks-1>*4(r8),r6 ;address of last longword in that array 3$: cmpl r5,(r8) ;this element? blss 2$ ;else get next 1$: movl -(r6),4(r6) ;copy an item down one position sobgtr r7,1$ ;done all array entries yet? movl r5,(r8) ;if so, this must be the place brb 4$ 2$: tstl (r8)+ ;advance one element sobgeq r7,3$ ;if not at end, do it again 4$: rsb endspt: .long 0 ;the living end, man! .end sptfrag