From owner-svn-src-head@FreeBSD.ORG Mon Jan 28 14:51:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1867332D; Mon, 28 Jan 2013 14:51:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 8A84FEC; Mon, 28 Jan 2013 14:51:19 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0SEpDFB002577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Jan 2013 01:51:15 +1100 Date: Tue, 29 Jan 2013 01:51:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Zonov Subject: Re: svn commit: r246033 - head/usr.bin/systat In-Reply-To: <201301281257.r0SCvhhv071414@svn.freebsd.org> Message-ID: <20130129003913.G2698@besplex.bde.org> References: <201301281257.r0SCvhhv071414@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=P/xiHV8u c=1 sm=1 a=VYs4l19NTHwA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=hP3lJxi6wgAA:10 a=ejpqoXUJjIB3LjvBEa4A:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 14:51:20 -0000 On Mon, 28 Jan 2013, Andrey Zonov wrote: > Log: > - Show page faults requiring I/O on vmstat display. No space is available there for showing it. > Modified: head/usr.bin/systat/vmstat.c > ============================================================================== > --- head/usr.bin/systat/vmstat.c Mon Jan 28 12:54:53 2013 (r246032) > +++ head/usr.bin/systat/vmstat.c Mon Jan 28 12:57:42 2013 (r246033) > @@ -324,24 +325,25 @@ labelkre(void) > mvprintw(INTSROW, INTSCOL + 1, "Interrupts"); > mvprintw(INTSROW + 1, INTSCOL + 6, "total"); > > - mvprintw(VMSTATROW, VMSTATCOL + 9, "cow"); > - mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "zfod"); > - mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "ozfod"); > - mvprintw(VMSTATROW + 3, VMSTATCOL + 9 - 1, "%%ozfod"); > - mvprintw(VMSTATROW + 4, VMSTATCOL + 9, "daefr"); > - mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "prcfr"); > - mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "totfr"); > - mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "react"); > - mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "pdwak"); > - mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdpgs"); > - mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "intrn"); > - mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "wire"); > - mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "act"); > - mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "inact"); > - mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "cache"); > - mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "free"); > - if (LINES - 1 > VMSTATROW + 16) > - mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "buf"); This is the last possible line on a 25-line display. On a 24-line display, it is omitted so that it doesn't mangle or get mangled by the prompt/status line. But previous lines are not specially handled, and neither are other parts of the display. Also, the interrupt display may reach the last line of the window, and then it interacts with the prompt/status line even on a 25-line display. On a 23-line display, mangling occurs as follows: - the special case for the "buf" line has no visible effect, since this line is outside of the window - the free "line" and the prompt/status line are both on the last line in the window, together with the %busy display and possibly the interrupts display. These mangle each other, On a 22-line display, the mangling moves up by 1 line and becomes worse. Now there seems to be a windowing bug. Some field (the "free" one) is mispositioned, so the display becomes magled (instead of just truncated) even when the prompt/status line is not used. > + mvprintw(VMSTATROW, VMSTATCOL + 9, "ioflt"); Putting it first unsorts the fields a bit and makes the diff large. It is not documented in the man page. > + mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "cow"); > + mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "zfod"); > + mvprintw(VMSTATROW + 3, VMSTATCOL + 9, "ozfod"); > + mvprintw(VMSTATROW + 4, VMSTATCOL + 9 - 1, "%%ozfod"); > + mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "daefr"); > + mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "prcfr"); > + mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "totfr"); > + mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "react"); > + mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdwak"); > + mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "pdpgs"); > + mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "intrn"); > + mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "wire"); > + mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "act"); > + mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "inact"); > + mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "cache"); > + mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "free"); > + if (LINES - 1 > VMSTATROW + 17) > + mvprintw(VMSTATROW + 17, VMSTATCOL + 9, "buf"); Adding a field at the top pushes the "buf" field to the last line of the window in the most common case of a 25-line display, and makes its special case useless except for 26-line displays, so mangling from the "buf" line now occurs in the most common case. It moves the problems for 22-24 line displays to 23-25 line displays, respectively. Now it is the "free" field that needs the special handling to avoid mangling in the nextmost common case of 24-line displays. Even more seriously, the "free" field is much more interesting than the "buf" field, so we don't want to lose it or have it mangled in a common case. The "buf" field really belongs in another group of fields (before "dtbuf") but is spaced where it is since there is no free space near "dtbuf" but just 1 line of free space (in the most common case) in the vmmeter fields column ("buf" also isn't a vmmeter field so it doesn't belong there). But now there are 0 lines of free space there. Since systat output barely works with screen depths other than 24 and 25 lines, omitting the "buf" field after moving its special case to the "free" field and moving some less important field than "free" to the end would be the simplest fix. The "buf" field is worse than useless because it is just the constant limit on the amount of virtual memory for buffers (nbuf * BKVASIZE). It is not merely useless, since it wastes space and confuses users into thinking that it is useful. top(1) prints it too. In other OS's top(1) prints something related to buffer resources that is actually useful. The related usful values in FreeBSD are the non-constant amount of physical memory mapped to buffers and to a lesser extent the non-constant amount of virtual memory mapped to buffers. These are not directly available. Also the amount of malloced memory pointed to by buffers (available in vfs.bufmallocspace), and the amount of disk space cached in VMIO buffers (not directly available, buf "inact" often approximates it). But there is no space for these. "buf" is even more useless with zfs. So are some of the other fields printed by systat and top. I think zfs has its own statistics programs, but it would be especially difficult to combine these with systat statistics see the combined resource usage if both zfs and file systems using the buffer cache/VMIO are active. Bruce