-- --**************************************************************************** --* * --* Copyright (c) 2001 * --* by DIGITAL Equipment Corporation, Maynard, Mass. * --* * --* This software is furnished under a license and may be used and copied * --* only in accordance with the terms of such license and with the * --* inclusion of the above copyright notice. This software or any other * --* copies thereof may not be provided or otherwise made available to any * --* other person. No title to and ownership of the software is hereby * --* transferred. * --* * --* The information in this software is subject to change without notice * --* and should not be construed as a commitment by DIGITAL Equipment * --* Corporation. * --* * --* DIGITAL assumes no responsibility for the use or reliability of its * --* software on equipment which is not supplied by DIGITAL. * --* * --**************************************************************************** --******************************************************************************************************************** -- Created: 15-MAR-2001 22:51:56 by OpenVMS SDL EV1-33 -- Source: 4-OCT-1994 04:17:33 $11$DUA933:[LIB_ADA.LIS]F11BCDEF.SDL;1 --******************************************************************************************************************** with SYSTEM; use SYSTEM; with STARLET; use STARLET; with CONDITION_HANDLING; use CONDITION_HANDLING; package F11BCDEF is -- module $F11BCDEF --+ -- F11BC - Files 11 Block Cache -- -- Header area which describes block cache used by F11BXQP. -- --- -- The next four constants are to do with minimum cache allowances for XQP activity -- per process. These minima control not ionly minimum cache size but also -- stalling for XQP activity. -- F11BC_K_MAPCACHE_MIN : constant := 1; -- Bitmap.sys buffers per process F11BC_K_HDRCACHE_MIN : constant := 4; -- Indexf.sys buffers per process F11BC_K_DIRCACHE_MIN : constant := 2; -- Dir/quota buffers per process F11BC_K_DINDXCACHE_MIN : constant := 1; -- Directory index `buffers' per process -- The next four constants are to control the minimum number of fluid buffers a -- process can hold in the XQP cache. (Fluid buffers == buffers that are not pinned in cache) -- F11BC_K_MAPCACHE_FLUIDMIN : constant := 1; -- Bitmap.sys buffers per process F11BC_K_HDRCACHE_FLUIDMIN : constant := 3; -- Indexf.sys buffers per process F11BC_K_DIRCACHE_FLUIDMIN : constant := 2; -- Dir/quota buffers per process F11BC_K_DINDXCACHE_FLUIDMIN : constant := 1; -- Directory index `buffers' per process F11BC_K_NUM_POOLS : constant := 4; -- Number of buffer pools. type F11BC_TYPE is record BUFBASE : UNSIGNED_LONGWORD; -- Base address of buffer area. BUFSIZE : UNSIGNED_LONGWORD; -- Size of buffer area in bytes. SIZE : UNSIGNED_WORD; -- Standard size field. TYP : UNSIGNED_BYTE; -- Standard type field. SUBTYP : UNSIGNED_BYTE; -- Standard subtype field. REALSIZE : UNSIGNED_LONGWORD; -- Structure size as a longword. LBNHSHBAS : UNSIGNED_LONGWORD; -- Base of LBN hash table. LBNHSHCNT : UNSIGNED_LONGWORD; -- Count of entries in LBN hash tbl. BFRCNT : UNSIGNED_LONGWORD; -- Total buffer count. BFRDBAS : UNSIGNED_LONGWORD; -- Buffer descriptor base address. BFRLDBAS : UNSIGNED_LONGWORD; -- Buffer lock descriptor base addr. BLHSHBAS : UNSIGNED_LONGWORD; -- Base addr of buffer lock hash tbl. BLHSHCNT : UNSIGNED_LONGWORD; -- Num entries in buff lock hash tbl. FREEBFRL : UNSIGNED_LONGWORD; -- Address of first free buffer lock block. POOL_LRU : INTEGER_64_ARRAY (1 .. 4); -- Per pool LRU listhead. POOL_WAITQ : INTEGER_64_ARRAY (1 .. 4); -- Per pool cache wait listhead. WAITCNT : INTEGER_32_ARRAY (1 .. 4); -- Count of waiters per pool. POOLAVAIL : INTEGER_32_ARRAY (1 .. 4); -- Available buffers per pool. POOLCNT : INTEGER_32_ARRAY (1 .. 4); -- Count of buffers per pool. AMBIGQFL : UNSIGNED_LONGWORD; -- Ambiguity queue forward link. AMBIGQBL : UNSIGNED_LONGWORD; -- Ambiguity queue back link. -- -- Cache performance counters. -- PROCESS_HITS : UNSIGNED_LONGWORD; -- In-process buffer hits. VALID_HITS : UNSIGNED_LONGWORD; -- Valid buffer cache hits. INVALID_HITS : UNSIGNED_LONGWORD; -- Buffer found but invalid contents. MISSES : UNSIGNED_LONGWORD; -- Buffer not in cache at all. DISK_READS : UNSIGNED_LONGWORD; -- Buffer reads from disk. DISK_WRITES : UNSIGNED_LONGWORD; -- Buffer writes to disk. CACHE_SERIAL : UNSIGNED_LONGWORD; -- Cache serialization calls. CACHE_STALLS : UNSIGNED_LONGWORD; -- Cache serialization stalls. BUFFER_STALLS : UNSIGNED_LONGWORD; -- Stalls for lack of buffers. CACHENAME : STRING(1 .. 24); -- Name of this cache (display only). LOG_BUFFER : UNSIGNED_LONGWORD; -- Pointer to activity log buffer end record; for F11BC_TYPE use record BUFBASE at 0 range 0 .. 31; BUFSIZE at 4 range 0 .. 31; SIZE at 8 range 0 .. 15; TYP at 10 range 0 .. 7; SUBTYP at 11 range 0 .. 7; REALSIZE at 12 range 0 .. 31; LBNHSHBAS at 16 range 0 .. 31; LBNHSHCNT at 20 range 0 .. 31; BFRCNT at 24 range 0 .. 31; BFRDBAS at 28 range 0 .. 31; BFRLDBAS at 32 range 0 .. 31; BLHSHBAS at 36 range 0 .. 31; BLHSHCNT at 40 range 0 .. 31; FREEBFRL at 44 range 0 .. 31; POOL_LRU at 48 range 0 .. 255; POOL_WAITQ at 80 range 0 .. 255; WAITCNT at 112 range 0 .. 127; POOLAVAIL at 128 range 0 .. 127; POOLCNT at 144 range 0 .. 127; AMBIGQFL at 160 range 0 .. 31; AMBIGQBL at 164 range 0 .. 31; PROCESS_HITS at 168 range 0 .. 31; VALID_HITS at 172 range 0 .. 31; INVALID_HITS at 176 range 0 .. 31; MISSES at 180 range 0 .. 31; DISK_READS at 184 range 0 .. 31; DISK_WRITES at 188 range 0 .. 31; CACHE_SERIAL at 192 range 0 .. 31; CACHE_STALLS at 196 range 0 .. 31; BUFFER_STALLS at 200 range 0 .. 31; CACHENAME at 204 range 0 .. 191; LOG_BUFFER at 228 range 0 .. 31; end record; for F11BC_TYPE'SIZE use 1856; F11BC_TYPE_INIT : constant F11BC_TYPE := (BUFBASE => 0, BUFSIZE => 0, SIZE => 0, TYP => 0, SUBTYP => 0, REALSIZE => 0, LBNHSHBAS => 0, LBNHSHCNT => 0, BFRCNT => 0, BFRDBAS => 0, BFRLDBAS => 0, BLHSHBAS => 0, BLHSHCNT => 0, FREEBFRL => 0, POOL_LRU => (others => (0, 0)), POOL_WAITQ => (others => (0, 0)), WAITCNT => (others => 0), POOLAVAIL => (others => 0), POOLCNT => (others => 0), AMBIGQFL => 0, AMBIGQBL => 0, PROCESS_HITS => 0, VALID_HITS => 0, INVALID_HITS => 0, MISSES => 0, DISK_READS => 0, DISK_WRITES => 0, CACHE_SERIAL => 0, CACHE_STALLS => 0, BUFFER_STALLS => 0, CACHENAME => (others => ASCII.NUL), LOG_BUFFER => 0); -- -- Buffer descriptors. -- BFRD_M_DIRTY : constant := 16#00000004#; BFRD_M_VALID : constant := 16#00000008#; BFRD_M_ASYNCH_IN_PROG : constant := 16#00000010#; BFRD_M_PINNED : constant := 16#00000020#; type BFRD_FLAGS_TYPE is -- Status flags. record POOL : UNSIGNED_2; -- Pool number of this buffer. DIRTY : BOOLEAN; -- Buffer has been modified. VALID : BOOLEAN; -- Buffer has been read from disk. ASYNCH_IN_PROG : BOOLEAN; -- This buffer involved in a deferred -- cache write PINNED : BOOLEAN; -- Buffer is pinned in cache FILLER_1 : UNSIGNED_2; end record; for BFRD_FLAGS_TYPE use record POOL at 0 range 0 .. 1; DIRTY at 0 range 2 .. 2; VALID at 0 range 3 .. 3; ASYNCH_IN_PROG at 0 range 4 .. 4; PINNED at 0 range 5 .. 5; FILLER_1 at 0 range 6 .. 7; end record; for BFRD_FLAGS_TYPE'SIZE use 8; BFRD_FLAGS_TYPE_INIT : constant BFRD_FLAGS_TYPE := (POOL => 0, DIRTY => FALSE, VALID => FALSE, ASYNCH_IN_PROG => FALSE, PINNED => FALSE, FILLER_1 => 0); type BFRD_TYPE is record QFL : UNSIGNED_LONGWORD; -- Queue forward link. QBL : UNSIGNED_LONGWORD; -- Queue back link. LBN : UNSIGNED_LONGWORD; -- LBN of buffer. UCB : UNSIGNED_LONGWORD; -- UCB of buffer. LOCKBASIS : UNSIGNED_LONGWORD; -- Unique file identifier. SEQNUM : UNSIGNED_LONGWORD; -- Buffer validation sequence number. FLAGS : BFRD_FLAGS_TYPE; -- Status flags. BTYPE : UNSIGNED_BYTE; -- Buffer type. FILLER_1 : UNSIGNED_WORD; CURPID : UNSIGNED_LONGWORD; -- Index of current process. NXTBFRD : UNSIGNED_LONGWORD; -- Index of next BFRD (hash chain). BFRL : UNSIGNED_LONGWORD; -- Address of buffer lock descriptor SAME_BFRL : UNSIGNED_LONGWORD; -- Index to next BFRD under same BFRL THREAD : UNSIGNED_LONGWORD; -- Identify ownership by thread as -- well as PID end record; for BFRD_TYPE use record QFL at 0 range 0 .. 31; QBL at 4 range 0 .. 31; LBN at 8 range 0 .. 31; UCB at 12 range 0 .. 31; LOCKBASIS at 16 range 0 .. 31; SEQNUM at 20 range 0 .. 31; FLAGS at 24 range 0 .. 7; BTYPE at 25 range 0 .. 7; FILLER_1 at 26 range 0 .. 15; CURPID at 28 range 0 .. 31; NXTBFRD at 32 range 0 .. 31; BFRL at 36 range 0 .. 31; SAME_BFRL at 40 range 0 .. 31; THREAD at 44 range 0 .. 31; end record; for BFRD_TYPE'SIZE use 384; BFRD_TYPE_INIT : constant BFRD_TYPE := (QFL => 0, QBL => 0, LBN => 0, UCB => 0, LOCKBASIS => 0, SEQNUM => 0, FLAGS => BFRD_FLAGS_TYPE_INIT, BTYPE => 0, FILLER_1 => 0, CURPID => 0, NXTBFRD => 0, BFRL => 0, SAME_BFRL => 0, THREAD => 0); -- -- Buffer lock descriptor blocks. -- type BFRL_TYPE is record NXTBFRL : UNSIGNED_LONGWORD; -- Address of next BFRL in hash chain. BFRD : UNSIGNED_LONGWORD; -- Index to first BFRD REFCNT : UNSIGNED_LONGWORD; -- Number of buffers backed by this lock. LKID : UNSIGNED_LONGWORD; -- Lock ID of buffer lock. LCKBASIS : UNSIGNED_LONGWORD; -- Unique file identifier. PARLKID : UNSIGNED_LONGWORD; -- Unique volume set identifier. end record; for BFRL_TYPE use record NXTBFRL at 0 range 0 .. 31; BFRD at 4 range 0 .. 31; REFCNT at 8 range 0 .. 31; LKID at 12 range 0 .. 31; LCKBASIS at 16 range 0 .. 31; PARLKID at 20 range 0 .. 31; end record; for BFRL_TYPE'SIZE use 192; BFRL_TYPE_INIT : constant BFRL_TYPE := (NXTBFRL => 0, BFRD => 0, REFCNT => 0, LKID => 0, LCKBASIS => 0, PARLKID => 0); end F11BCDEF;