Basic System Problem Analysis - August 2003

19
File System Structures: continued
Finding The GUFD of an opened or closed file
GUFD’s for opened files are kept on a HASH_LINK from Storage Management Globals
(KSO #210, type SM_GLOBAL_REC”) and GUFD’s for closed files are kept on a least
recently used (LRU) list also from SM Globals. The top portion of the GUFD_T shows
these links:
GUFD_T =
RECORD
HASH_LINK : GUFD_PTR_TYPE;
LRU_LINK : GUFD_PTR_TYPE;
PREV_LRU_LINK : GUFD_PTR_TYPE;
When a process opens a disk file a search of these lists will be made to see if the file is
opened or if the file has been recently closed. Files do not remain on the LRU
indefinitely, the list can be no more than 1500 entries long and, if we should run short of
GUFD entries for files being opened, the oldest file on the LRU will be pulled off,
mapped out and the GUFD given over to a new file open request.
With MPE/iX 6.5 onward we also try to hold larger files, those over 1GB in size on the
LRU as long as possible because performance can suffer if a very large file is mapped out
all at once. These files are rotated around the LRU up to 16 times and at each rotation a
16
th
of the file is mapped out, from the bottom up. We map out from the bottom up so
that if the file is removed from the LRU because it has been re-opened chances are the
top portion of the file object will be referenced first and that will minimize the need to
page-fault the data in from disk.
The FS_FIND_GUFD_ENTRY macro can be used to locate a GUFD for an opened or
recently closed file. The macro takes as input the interval timer for the file you want to
locate. Since the interval timer is kept in the extended file label that is a good way to get
this information. It is not ever going to change so if you were looking at a memory dump
and for example wanted to locate the GUFD for XL.PUB.SYS you could use the interval
timer from the live system (assuming, of course, you’re logged on the system whose
memory dump you’re looking at!).
A LISTFILE, 3 will display provide the file label pointer, for example: