Exploring Arena Records

The following example illustrates the use of arena records:

>>> We start by asking the question: what ranges of addresses are
>>> currently allocated in the private arena of the process that's
>>> running the IPFC complier.

>>> List all processes to find the one of interest

# .p
 Slot  Pid  Ppid Csid Ord  Sta Pri  pTSD     pPTDA    pTCB     Disp SG Name
 0001  0001 0000 0000 0001 blk 0100 ffe3a000 ffe3c7d4 ffe3c61c 1e7c 00 *ager
 0002  0001 0000 0000 0002 blk 0200 7b7aa000 ffe3c7d4 7b9a8020 1f3c 00 *tsd
 0003  0001 0000 0000 0003 blk 0200 7b7ac000 ffe3c7d4 7b9a81d8 1f50 00 *ctxh
 0004  0001 0000 0000 0004 blk 081f 7b7ae000 ffe3c7d4 7b9a8390 1f48 00 *kdb
 0005  0001 0000 0000 0005 blk 0800 7b7b0000 ffe3c7d4 7b9a8548 1f20 00 *lazyw
 0006  0001 0000 0000 0006 blk 0800 7b7b2000 ffe3c7d4 7b9a8700 1f3c 00 *asyncr
 0009  0002 0000 0002 0001 blk 021f 7b7b8000 7b9c4020 7b9a8c28      00 LOGDAEM
 0008  0003 0001 0003 0001 rdy 061f 7b7b6000 7b9c484c 7b9a8a70 1eb8 01 PMSHL32
 000b  0003 0001 0003 0002 blk 0800 7b7bc000 7b9c484c 7b9a8f98      01 PMSHL32
 000c  0003 0001 0003 0003 blk 0800 7b7be000 7b9c484c 7b9a9150      01 PMSHL32
 000d  0003 0001 0003 0004 blk 0800 7b7c0000 7b9c484c 7b9a9308      01 PMSHL32
 000e  0003 0001 0003 0005 blk 0800 7b7c2000 7b9c484c 7b9a94c0      01 PMSHL32
 0007  0003 0001 0003 0006 blk 0200 7b7b4000 7b9c484c 7b9a88b8 1ecc 01 PMSHL32
 0011  0003 0001 0003 0007 blk 0200 7b7c8000 7b9c484c 7b9a99e8 1ecc 01 PMSHL32
 0012  0003 0001 0003 0008 blk 0200 7b7ca000 7b9c484c 7b9a9ba0      01 PMSHL32
 0013  0003 0001 0003 0009 blk 0200 7b7cc000 7b9c484c 7b9a9d58      01 PMSHL32
 0014  0003 0001 0003 000a blk 0800 7b7ce000 7b9c484c 7b9a9f10      01 PMSHL32
 0015  0003 0001 0003 000b blk 0800 7b7d0000 7b9c484c 7b9aa0c8      01 PMSHL32
 0016  0003 0001 0003 000c blk 0800 7b7d2000 7b9c484c 7b9aa280      01 PMSHL32
 0017  0003 0001 0003 000d blk 0804 7b7d4000 7b9c484c 7b9aa438 1ea8 01 PMSHL32
 0018  0003 0001 0003 000e rdy 0804 7b7d6000 7b9c484c 7b9aa5f0      01 PMSHL32
 0019  0003 0001 0003 000f blk 0500 7b7d8000 7b9c484c 7b9aa7a8      01 PMSHL32
 001a  0003 0001 0003 0010 rdy 0801 7b7da000 7b9c484c 7b9aa960 1bac 01 PMSHL32
 Slot  Pid  Ppid Csid Ord  Sta Pri  pTSD     pPTDA    pTCB     Disp SG Name
 001b  0003 0001 0003 0011 blk 0800 7b7dc000 7b9c484c 7b9aab18      01 PMSHL32
*001c# 0003 0001 0003 0012 run 0800 7b7de000 7b9c484c 7b9aacd0 1b8c 01 PMSHL32
 001d  0003 0001 0003 0013 blk 0200 7b7e0000 7b9c484c 7b9aae88      01 PMSHL32
 0023  0018 0003 0018 0001 rdy 061f 7b7ec000 7b9c7128 7b9ab8d8 1eb8 13 EPM
 0038  0018 0003 0018 0002 blk 0200 7b816000 7b9c7128 7b9adcf0 1ecc 13 EPM
 0037  0013 0003 0013 0001 blk 0200 7b814000 7b9c9a04 7b9adb38      19 IBMAVSD
 0033  0012 0003 0012 0001 blk 0200 7b80c000 7b9c89ac 7b9ad458 1eb8 17 PMDRAW
 0035  0012 0003 0012 0002 blk 0200 7b810000 7b9c89ac 7b9ad7c8 1eb8 17 PMDRAW
 0036  0012 0003 0012 0003 blk 0200 7b812000 7b9c89ac 7b9ad980      17 PMDRAW
 0034  0010 0003 0010 0001 blk 0400 7b80e000 7b9c91d8 7b9ad610 1ed4 12 CMD
 002e  000d 0003 000d 0001 blk 0200 7b802000 7b9c8180 7b9acbc0 1eb8 16 PULSE
 0030  000d 0003 000d 0002 rdy 0100 7b806000 7b9c8180 7b9acf30 1f28 16 PULSE
 002f  000d 0003 000d 0003 rdy 081f 7b804000 7b9c8180 7b9acd78 1f00 16 PULSE
 002d  000c 0003 000c 0001 blk 0200 7b800000 7b9c7954 7b9aca08 1eb8 15 DINFO
 0032  000c 0003 000c 0002 rdy 061f 7b80a000 7b9c7954 7b9ad2a0 1f00 15 DINFO
 002c  000b 0003 000b 0001 blk 0200 7b7fe000 7b9c58a4 7b9ac850 1eb8 14 MRFILE32
 0031  000b 0003 000b 0002 blk 0200 7b808000 7b9c58a4 7b9ad0e8 1ecc 14 MRFILE32
 0029  000a 0003 000a 0001 rdy 061f 7b7f8000 7b9c68fc 7b9ac328 1eb8 10 PMDIARY
 001f  0006 0003 0006 0001 rdy 062f 7b7e4000 7b9c60d0 7b9ab1f8 1eb8 11 PMSHL32
 0021  0006 0003 0006 0002 blk 0200 7b7e8000 7b9c60d0 7b9ab568      11 PMSHL32
 0022  0006 0003 0006 0003 blk 0200 7b7ea000 7b9c60d0 7b9ab720 1eb8 11 PMSHL32
 0020  0006 0003 0006 0004 blk 0200 7b7e6000 7b9c60d0 7b9ab3b0      11 PMSHL32
 001e  0006 0003 0006 0005 blk 0200 7b7e2000 7b9c60d0 7b9ab040 1ecc 11 PMSHL32
 0024  0006 0003 0006 0006 blk 0200 7b7ee000 7b9c60d0 7b9aba90      11 PMSHL32
 Slot  Pid  Ppid Csid Ord  Sta Pri  pTSD     pPTDA    pTCB     Disp SG Name
 0025  0006 0003 0006 0007 blk 0200 7b7f0000 7b9c60d0 7b9abc48      11 PMSHL32
 0026  0006 0003 0006 0008 blk 0200 7b7f2000 7b9c60d0 7b9abe00      11 PMSHL32
 0027  0006 0003 0006 0009 blk 0200 7b7f4000 7b9c60d0 7b9abfb8      11 PMSHL32
 0028  0006 0003 0006 000a blk 0200 7b7f6000 7b9c60d0 7b9ac170      11 PMSHL32
 002a  0006 0003 0006 000c blk 021f 7b7fa000 7b9c60d0 7b9ac4e0 1eac 11 PMSHL32
 002b  0006 0003 0006 000d blk 0200 7b7fc000 7b9c60d0 7b9ac698 1eb8 11 PMSHL32
 000a  0004 0003 0004 0001 blk 0800 7b7ba000 7b9c5078 7b9a8de0      00 HARDERR
 000f  0004 0003 0004 0002 blk 0800 7b7c4000 7b9c5078 7b9a9678      00 HARDERR
 0010  0004 0003 0004 0003 blk 0800 7b7c6000 7b9c5078 7b9a9830      00 HARDERR
 0039  0019 0010 0019 0001 rdy 061f 7b818000 7b9ca230 7b9adea8 1f0c 12 IPFC

>>> From the name printed in the right hand column we see that slot 39
>>> is the one of interest.


>>> Imbedded in each PTDA at offset +0x40 is the VMAH that heads the
>>> private arena. From the VMAH we can obtain the pointer to the
>>> sentinel area record.

>>> Dump out the VMAH for slot 39 using the pPTDA address from the
>>> .p command output...

# dd %7b9ca230+40 L10
%7b9ca270  7b9c7168 fff13190 feb24cae feb261bc
%7b9ca280  fe79ba54 fe87e9a0 fff03e30 00000002
%7b9ca290  00010000 00370000 00000000 00000000
%7b9ca2a0  00000003 00000000 00000041 000005db

>>> The third double word (feb24cae) is the address of the sentinel
>>> record. To format this using the .MA command we need to determin
>>> the handle for this record. Arena records are organised in a
>>> table of 0x16 byte length entries. Their handles are their
>>> corresponding table entry number. The address of the first
>>> arena record is located at symbol _parvmone...

# dd _parvmone l1
%fff13304  feb1f020

>>> Arena record 1 is located at %feb1f020. We wish to determine the
>>> handle for the sentinal, whose address is %feb24cae. We use the
>>> hex calculator facility of the Dump Formatter/Kernel Debugger thus..

# ? (%feb24cae-%feb1f020)/16 +1
%00000436

>>> The handle we require is 436. We can now format the sentinel
>>> for slot 39 ....

# .ma  436
 har     par      cpg        va    flg next prev link hash hob   hal
 0436 %feb24cae 00000000 %00010000 003 050a 0526 0005 0000 4000 0000 max=%04000000

>>> Note the max=%04000000 to the right indicating the current private
>>> arena maximum address is 64M - 1 and incidentally distinguishing
>>> this as a sentinel or boundary sentinel arena record.
>>> Note also that this is merely a boundary marker and not an indication
>>> of which addresses within the private arena have been allocated.

>>> Regular arena record are chained to the sentinel in a circular
>>> double linked list using the 'next' and 'prev' pointers.
>>> We can format the entire chain using .MAL (or .MAR) but we have to
>>> break in using Ctrl-C to stop the chain endlessly traversing the
>>> circular chain.

# .ma 50a
 har     par      cpg        va    flg next prev link hash hob   hal
 050a %feb25ee6 00000030 %00010000 1d9 0509 0436 0000 0000 05e2 0000 hptda=050c
# .ma 509
 har     par      cpg        va    flg next prev link hash hob   hal
 0509 %feb25ed0 00000010 %00040000 179 050b 050a 0000 0000 05dd 0000 hptda=050c
# .ma 50b
 har     par      cpg        va    flg next prev link hash hob   hal
 050b %feb25efc 00000010 %00050000 169 0507 0509 0000 0000 05e9 0000 hptda=050c
# .mal 507
 har     par      cpg        va    flg next prev link hash hob   hal
 0507 %feb25ea4 00000010 %00060000 169 0506 050b 0000 0000 05ea 0000 hptda=050c
 0506 %feb25e8e 00000010 %00070000 169 050f 0507 0000 0000 05eb 0000 hptda=050c
 050f %feb25f54 00000010 %00080000 169 050c 0506 0000 0000 05ec 0000 hptda=050c
 050c %feb25f12 00000010 %00090000 169 0511 050f 0000 0000 05ed 0000 hptda=050c
 0511 %feb25f80 00000010 %000a0000 169 050e 050c 0000 0000 05f0 0000 hptda=050c
 050e %feb25f3e 00000010 %000b0000 1c9 050d 0511 01c7 0000 05ee 0016 hptda=050c
 050d %feb25f28 00000010 %000c0000 169 0512 050e 0000 0000 05f1 0000 hptda=050c
 0512 %feb25f96 00000010 %000d0000 169 0513 050d 0000 0000 05f2 0000 hptda=050c
 0513 %feb25fac 00000010 %000e0000 169 0514 0512 0000 0000 05f3 0000 hptda=050c
 0514 %feb25fc2 00000010 %000f0000 169 0515 0513 0000 0000 05f4 0000 hptda=050c
 0515 %feb25fd8 00000010 %00100000 169 0516 0514 0000 0000 05f5 0000 hptda=050c
 0516 %feb25fee 00000010 %00110000 169 0517 0515 0000 0000 05f6 0000 hptda=050c
 0517 %feb26004 00000010 %00120000 169 0519 0516 0000 0000 05f7 0000 hptda=050c
 0519 %feb26030 00000010 %00130000 169 0518 0517 0000 0000 05f9 0000 hptda=050c
 0518 %feb2601a 00000010 %00140000 169 051a 0519 0000 0000 05f8 0000 hptda=050c
 051a %feb26046 00000010 %00150000 169 051b 0518 0000 0000 05fa 0000 hptda=050c
 051b %feb2605c 00000010 %00160000 169 051c 051a 0000 0000 05fb 0000 hptda=050c
 051c %feb26072 00000010 %00170000 169 051d 051b 0000 0000 05fc 0000 hptda=050c
 051d %feb26088 00000010 %00180000 169 051e 051c 0000 0000 05fd 0000 hptda=050c
 051e %feb2609e 00000010 %00190000 169 0521 051d 0000 0000 05fe 0000 hptda=050c
 0521 %feb260e0 00000010 %001a0000 169 0520 051e 0000 0000 0601 0000 hptda=050c
 0520 %feb260ca 00000010 %001b0000 169 051f 0521 0000 0000 0600 0000 hptda=050c
 051f %feb260b4 000000f0 %001c0000 169 0523 0520 0000 0000 05ff 0000 hptda=050c
 har     par      cpg        va    flg next prev link hash hob   hal
 0523 %feb2610c 00000010 %002b0000 169 0527 051f 0000 0000 0603 0000 hptda=050c
 0527 %feb26164 00000010 %002c0000 169 0522 0523 0000 0000 0607 0000 hptda=050c
 0522 %feb260f6 00000020 %002d0000 169 0525 0527 0000 0000 0602 0000 hptda=050c
 0525 %feb26138 00000010 %002f0000 169 0524 0522 0000 0000 0605 0000 hptda=050c
 0524 %feb26122 00000010 %00300000 169 052a 0525 0000 0000 0604 0000 hptda=050c
 052a %feb261a6 00000010 %00310000 169 052d 0524 0000 0000 060a 0000 hptda=050c
 052d %feb261e8 00000010 %00320000 169 0529 052a 0000 0000 060d 0000 hptda=050c
 0529 %feb26190 00000010 %00330000 169 052b 052d 0000 0000 0609 0000 hptda=050c
 052b %feb261bc 00000020 %00340000 169 0526 0529 0000 0000 060b 0000 hptda=050c
 0526 %feb2614e 00000010 %00360000 169 0436 052b 0000 0000 0606 0000 hptda=050c
 0436 %feb24cae 00000000 %00010000 003 050a 0526 0005 0000 4000 0000 max=%04000000
 050a %feb25ee6 00000030 %00010000 1d9 0509 0436 0000 0000 05e2 0000 hptda=050c
 0509 %feb25ed0 00000010 %00040000 179 050b 050a 0000 0000 05dd 0000 hptda=050c

#

>>> Each regular private arena record is distinguished by the appearence
>>> hptda=nnn to the right of each line. This is the handle of the PTDA
>>> of the process to which the arena record belongs. Each of the hptda
>>> values is 50c indicating each of regular arena records above belongs
>>> to the same process. More on the hptda later.

>>> Each regular arena represents the address range reserved for a
>>> memory object. cpg is the size reservation in pages, but note
>>> that this is only an address space reservation, not necessarily what
>>> is currently committed. Most objects reserve 0x10
>>> pages or 64K, which corresponds to the maximum 16-bit segment size.

>>> va shows the start address of each memory object.
>>> By examining va and cpg we can see that the minimum and maximum
>>> addresses allocated in the private arena of slot 39 is %10000 and
>>> %36ffff (=%360000 + 0x10 pages -1). We can also see that this
>>> allocation is contiguous and therefore the total allocated private
>>> arena virtual address space is 0x360000 bytes or 3.375M

>>> The VMAH records the minimum and maximum +1 allocated addresses
>>> at +0x20 and +0x24, but the allocation might be sparse so the VMAH
>>> does not indicate directly the total memory in use.

>>> We now move onto the shared arena.

>>> The link field of each sentinel points to the boundary sentinel


# .ma  436
 har     par      cpg        va    flg next prev link hash hob   hal
 0436 %feb24cae 00000000 %00010000 003 050a 0526 0005 0000 4000 0000 max=%04000000
# .ma 5
 har     par      cpg        va    flg next prev link hash hob   hal
 0005 %feb1f078 00011a20 %04000000 007 0508 0075 0000 0000 fff0 0000 max=%1fff0000

>>> Once again each regular arena record in the shared arena is linked
>>> in a circular double linked list. This time we enter the chain from
>>> the boundry sentinel next and prev fields.

# .mal 508
 har     par      cpg        va    flg next prev link hash hob   hal
 0508 %feb25eba 00000010 %15a20000 369 0437 0005 0000 0000 05df 0000  hco=008a8
 0437 %feb24cc4 00000010 %15a40000 369 0438 0508 0000 0000 050d 0000  hco=00248
 0438 %feb24cda 00000010 %15a50000 369 0444 0437 0000 0000 050e 0000  hco=0076e
 0444 %feb24de2 00000020 %15a60000 3d9 0441 0438 0000 0000 0518 0000  hco=007aa
 0441 %feb24da0 00000010 %15a80000 3d9 043b 0444 0000 0000 051a 0000  hco=007a9
 043b %feb24d1c 00000010 %15a90000 3d9 043a 0441 0000 0000 0517 0000  hco=002b7
 043a %feb24d06 00000010 %15aa0000 3d9 0443 043b 0000 0000 0511 0000  hco=007a8
 0443 %feb24dcc 00000010 %15ab0000 179 0439 043a 0000 0000 0519 0000      =0000
 0439 %feb24cf0 00000010 %15ac0000 369 0433 0443 0000 0000 050f 0000  hco=00763
 0433 %feb24c6c 00000010 %15ad0000 369 0432 0439 0000 0000 0509 0000  hco=00777
 0432 %feb24c56 00000010 %15ae0000 369 041e 0433 0000 0000 0508 0000  hco=00776
 041e %feb24a9e 00000030 %15af0000 369 041c 0432 0000 0000 04f4 0000  hco=007d8
 041c %feb24a72 00000010 %15b20000 369 03ee 041e 0000 0000 04d1 0000  hco=0075c
 03ee %feb2467e 00000010 %15b30000 349 03eb 041c 0000 0000 04c1 0000  hco=001f6

 .
 .
 .
 .
 .
 .

 0169 %feb20f10 00000010 %1acb0000 179 0168 016a 0000 0000 05e6 0000      =0000
 0168 %feb20efa 00000020 %1acc0000 379 0077 0169 0000 0000 01af 0000  hco=007c0
 0077 %feb1fa44 00000010 %1bfe0000 349 0075 0168 0000 0000 0077 0000  hco=007a7
 0075 %feb1fa18 00000010 %1bff0000 349 0005 0077 0000 0000 0075 0000  hco=007b8
 0005 %feb1f078 00011a20 %04000000 007 0508 0075 0000 0000 fff0 0000 max=%1fff0000
 0508 %feb25eba 00000010 %15a20000 369 0437 0005 0000 0000 05df 0000  hco=008a8
 0437 %feb24cc4 00000010 %15a40000 369 0438 0508 0000 0000 050d 0000  hco=00248

>>> There are two types of regular arena record that appear in the
>>> Shared arena. These are distinguished by the right-hand column:
>>>   hco=nnnnn
>>>      =0000
>>> The first type is global shared data. The hco is the context record
>>> handle, which will be discussed later.
>>> The second type represents instance data. Both of these will be
>>> looked at in more detail in the next section.

>>> Finally we look at the system arena. The sentinel for the system
>>> arena is har=4. Once again each regular arena record is linked
>>> in a circular double-linked list.

# .ma 4
 har     par      cpg        va    flg next prev link hash hob   hal
 0004 %feb1f062 00000000 %60000000 003 0504 0016 0000 0000 ffc0 0000 max=%fffc0000
# .mal 504
 har     par      cpg        va    flg next prev link hash hob   hal
 0504 %feb25e62 00000010 %79eb7000 121 03d2 0004 0000 0081 05e1 0000      =0000
 03d2 %feb24416 00000010 %79ec7000 121 0363 0504 0000 0080 049e 0000      =0000
 0363 %feb23a8c 00000010 %79ed7000 121 0374 03d2 0000 007f 0434 0000      =0000
 0374 %feb23c02 00000010 %79ee7000 121 02e4 0363 0000 0095 0422 0000      =0000
 02e4 %feb22fa2 00000010 %79ef7000 121 02db 0374 0000 00df 0382 0000      =0000
 02db %feb22edc 00000010 %79f07000 121 02cc 02e4 0000 007c 036e 0000      =0000
 02cc %feb22d92 00000010 %79f17000 121 0405 02db 0000 007b 0350 0000      =0000

 .
 .
 .
 .

 0012 %feb1f196 00000016 %ffefe000 001 0013 0011 0000 0000 0013 0000      =0000
 0013 %feb1f1ac 00000010 %fff14000 009 0014 0012 0000 0000 0014 0000   sel=0150
 0014 %feb1f1c2 0000000a %fff24000 009 0015 0013 0000 0000 0015 0000   sel=0158
 0015 %feb1f1d8 00000010 %fff2e000 009 0016 0014 0000 0000 0016 0000   sel=0160
 0016 %feb1f1ee 00000082 %fff3e000 001 0004 0015 0000 0000 0017 0000      =0000
 0004 %feb1f062 00000000 %60000000 003 0504 0016 0000 0000 ffc0 0000 max=%fffc0000
 0504 %feb25e62 00000010 %79eb7000 121 03d2 0004 0000 0081 05e1 0000      =0000
 03d2 %feb24416 00000010 %79ec7000 121 0363 0504 0000 0080 049e 0000      =0000


>>> Two types of regular record appear, distinguished by the right-hand
>>> column:
>>>     =0000
>>>  sel=nnnn
>>> The first of these indicates heap data. The second GDT selector
>>> assigned data. Device driver and IFS code and data objects will
>>> appear among these.


[Back: Who Owns Virtual Memory and Who Allocated it?]
[Next: Exploring Object Records]