bufview(1) bufview(1) NAME bufview - file system buffer cache activity monitor SYNOPSIS bufview [ -options ] DESCRIPTION bufview displays periodic information about the file system buffer cache. It is modeled after the program top(1) which displays information about running processes. OPTIONS -b Use batch (or non-interactive mode). -s delay Wait delay seconds between updates. The default is 3 seconds. -d count Update the display count times and then exit. The default is to continually update. -n lines Display only lines number of buffers. The default is to display as many buffers as will fit the screen when in interactive mode, or all buffers when in batch mode. -f flags Only display buffers which have the specified flags bits set. -o order display buffers using the specified sort order. -S Do not display system buffers. -D Do not display data buffers. INTERACTIVE MODE bufview accepts display commands interactively. These commands are currently recognized: ^L Redraw the screen. h or ? Display a summary of the commands (help screen). q Quit. s Change number of seconds to delay between updates. S Toggle display of system buffers on or off. D Toggle display of file data buffers on or off. o Specify buffer display order (see details below). f Display only buffers with specific state flags set (see details below). F Ignore buffer state flags when determining which buffers to display. m Display only buffers from the specified device (mounted file system). M Display buffers from all mounted file systems. This is the default behaviour. FILE SYSTEM BUFFERS There are a set number of buffer headers allocated by the system when it starts up, but the memory attached to each buffer changes over time. In the Irix operating system, a distinction is made between data buffers, which hold the data from regular files, and system or meta-data buffers, which hold the file system control data, such as directories, inodes and file system mapping information. The file system buffer cache is integrated with the memory page allocator. Any pages which contain file system data are remembered; if the pages are released from a buffer header because the buffer is asked to represent different data, the pages can be reclaimed by another buffer later if the pages haven't been reused in the meantime. Thus pages of memory which hold file data can be: attached to buffers; or attached to one or more user processes (see mmap(2)), separately or at the same time; or on the free page list. GLOBAL INFORMATION The first few lines of the display monitor system-wide statistics. These include buffer counts, memory values, events and time values. The total number of buffers is displayed as Bufs; at any moment, each of these buffers is accounted for as either Sys, Data, Empty or Inact. Sys means that the buffer contains file system meta-data; a Data buffer hold regular file data. Empty implies that the buffer does not have any data stored at the moment; Inact means that the buffer is empty and has been removed from use temporarily to avoid having the buffer cache use too much memory. The total amount of system memory is displayed as Mem. The amount of memory associated with Sys and Data buffers is displayed as SMem and DMem. The current amount of free memory is displayed as MFree; the portion of that memory that holds (reclaimable) file system data is shown as MFreD. Various system memory limiters are also shown. The operating system avoids having the amount of memory in Data buffers grow too large. To such end, the system tuneable parameter, min_free_pages, specifies how many pages should be on the free list. If there are fewer, the Data buffers will be trimmed, but only as low as min_file_pages (see systune(1)). min_file_pages and min_free_pages are shown, as memory amounts, in DMin and FrMin. There are two other limits to the amount of memory the buffer Data cache can use. There are two system counters known as availrmem and availsmem, which indicate, respectively, how many physical pages would be available if push came to shove (that is, if the system paging daemon were to push every possible user page out of memory and in to backing store); and how many pages of memory and backing store (swap) have not been reserved by programs and the kernel. These two counters are expressed as memory amounts by MaxR and MaxS. In the 6.5 operating system release, Data buffer pages are not accounted for in either availrmem or availsmem, but since the Data cache can never be forced to drop below min_file_pages, the system must ensure that: first, neither availrmem nor availsmem drop below min_file_pages; and second, that if the Data cache grows beyond min_file_pages, it does not grow beyond the avail counters. These values are displayed as a diagnostic tool to help understand whether there are enough buffers allocated for the system, whether the cache is responding well enough to various memory pressures, and whether the tuneable parameters are configured sanely. If the buffer cache memory must be trimmed, individual buffer headers are inactivated. Inactivated buffers, displayed as Inact are those which are both trimmed of their memory and also removed from the buffer free lists so that won't be immediately refilled to represent other file system data. When the system decides that the amount of memory allocated to buffers can grow, and there are no empty buffers available, inactive buffers are activated (put back on a free list). Some event counters are also shown. The number of times a buffer is inactivated is shown as deact; conversly, reactivations are shown as react. The number of times a particular buffer is sought is given as gtblk; the times a sought buffer is found in the cache is found. If a particular buffer isn't found in the buffer cache, a buffer free list is searched for the first available buffer that can be reclaimed. Buffers that have delayed write data or that have special release functions associated with them are not directly acquired in the search for available buffers; instead they are written (write) or the release function is called (relse), and skipped. Buffers have a counter which, when set, allows the buffer to pass through the free list search unscathed (the counter is decremented each time it is examined). The counter stky indicated these events. Note that all event counters are given as events per second since the display was last updated. The current time is also shown, as well as the current system clock tick value. Note that all event counters are labeled with names that contain no upper-case letters, and that all memory values are labeled with names that contain an upper-case 'M'. With memory values, a 'K' represents 1024 bytes, an 'M' is 1024 K and so on. Buffer counters are given as decimal values, and their labels all start with upper-case characters. DISPLAY ORDER The display sort order and any pruning flags are also displayed. The sort order determines in what order buffers are to be displayed; and pruning flags, if specified, indicated that bufview should only display buffers with the indicated flags set. The following sort keys can be specified: m display the files with the most buffers attached l display the files with the least buffers attached b display the biggest buffers first s display the smallest buffers first n display the newest buffers first o display the oldest buffers first Note that bufview can be in either aggregate mode or itemized mode. When in aggregate mode, all files (for regular file data) or devices (for system data) that are currently using buffers are represented as a single buffer; in itemized mode, individual buffers are presented. By default, bufview runs in aggregate mode and sorts using m and b as the sort keys. The display order can be changed, either interactively or as a command-line option. Either way, the last order specifier given becomes the first sort key. If any pruning flags are requested, only those buffers which have the corresponding flags set will be displayed. The following pruning flags can be specified: dw display delayed write buffers bsy display in-use (busy) buffers as display buffers being used for asynchronous reads/writes na display NFS buffers being used for async reads/writes da display buffers without allocated backing-store nc display NFS3 buffers without committed backing-store swp display buffers being used to swap user pages inact display inactive buffers ino display inode buffers inomap display inode map buffers dir_bt display buffers containing directory btrees map display buffers containing maps attr_bt display attribute btree buffers agi display buffers containing AG header (inode allocation) agf display allocation group header buffers agfl display allocation group free block array buffers dquot display quota buffers containing dquot structures These, too, can be specified as command-line options or demanded interactively. Further, pruning flags can be removed (wholesale) with the F interactive command. If a display order or flag specifier is given that is incompatible with the current mode, the mode changes and any incompatible sort or display directives are removed. For example, the n display order and all pruning flags are incompatible with aggregate mode; if any of these are specified, m or l will be removed as a sort key. Similarly, if either m and l are demanded, bufview will convert to aggregate mode, and any pruning flags or itemized sort keys will be deleted. THE DISPLAY The information displayed about buffers changes depending whether bufview is in aggregate mode or itemized mode. In either mode, the internal node number of the file is displayed under the column VNUMBER for data buffers, or listed simply as a 'system' file if the buffer represents a meta-data buffer. In aggregate mode, the next column is NAME. Only data file names are given, and only those whose names are brief enough to be included in the system's internal directory name cache (currently 31 bytes). The names displayed by bufview are truncated. A file whose name is too large to fit in the name cache is displayed as '?'; if the system cannot determine the name of the file because it would have had to sleep waiting for an internal lock, the file names is displayed as '??'. In itemized mode the column NAME/REF shows either the (possibly truncated) file name or, for meta-data buffers, a pseudo-reference counter which, if non-zero, allows a buffer a free trip though the buffer free list. The column DEVICE gives the last component(s) of the file system path name of the device from which the file system for the given buffer's file is mounted. The column FSTYP gives an indication of the type of file system that is being managed by the buffer. In aggregate mode, the next column is NBUF, which is the number of buffers currently holding data or meta-data for the particular file or file system, respectively. The aggregate buffer size and the amount of buffer memory which is delayed-write is shown as SIZE and DELWRI. (Delayed write means that the buffer has been altered but the new contents have not yet been written to backing store.) The final two columns in aggregate mode, LOW and HIGH, represent the lowest and highest bytes represented by the buffers mapping the object. For data buffers, they refer to logical offsets within the file; for meta-data buffers, offsets within the file system. In itemized mode, the index of the particular buffer in the system's buffer array is given as BUF. Its size is given next as SIZE, and OFFSET the offset within the file or file system of the first byte mapped by the buffer. The column AGE shows the clock tick stored in the buffer. This value is set when the buffer is first created and reset whenever the buffer is accessed or modified. Lastly, interesting buffer flags are shown under FLAGS. The list of flags which might be displayed are exactly those which can be specified as display pruning flags. FILES /etc/mtab list of mounted file systems BUGS The buffer cache notion of a device number does not match that of the mounted file system for NFS file systems, so the device number, not its name, is displayed. SEE ALSO top(1), osview(1) Page 6