From owner-freebsd-bugs Mon Dec 10 5:50:10 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D5BB237B417 for ; Mon, 10 Dec 2001 05:50:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBADo1m29579; Mon, 10 Dec 2001 05:50:01 -0800 (PST) (envelope-from gnats) Date: Mon, 10 Dec 2001 05:50:01 -0800 (PST) Message-Id: <200112101350.fBADo1m29579@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Sheldon Hearn Subject: Re: bin/32667: systat waste too much time reading input Reply-To: Sheldon Hearn Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/32667; it has been noted by GNATS. From: Sheldon Hearn To: Bruce Evans Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/32667: systat waste too much time reading input Date: Mon, 10 Dec 2001 15:42:35 +0200 On Mon, 10 Dec 2001 05:30:02 PST, Bruce Evans wrote: > This seems to be because the VM_METER sysctl is increadibly slow. It > takes 13 msec here on an Athlon1600XP system with 512MB memory, but > "only" 3 msec on a Celeron366 system with 256MB memory. Are you sure? The originator reports that the following patch (which he sent me in private) makes the symptoms go away. Is it just because it reduces the number of queries to no more than 1 per second? Ciao, Sheldon. Index: keyboard.c =================================================================== RCS file: /home/ncvs/src/usr.bin/systat/keyboard.c,v retrieving revision 1.1.1.1 diff -u -d -r1.1.1.1 keyboard.c --- keyboard.c 27 May 1994 12:32:44 -0000 1.1.1.1 +++ keyboard.c 10 Dec 2001 13:37:07 -0000 @@ -54,8 +54,10 @@ do { refresh(); ch = getch() & 0177; - if (ch == 0177 && ferror(stdin)) { - clearerr(stdin); + if (ch == 0177) { + sleep(1); + if (ferror(stdin)) + clearerr(stdin); continue; } if (ch >= 'A' && ch <= 'Z') Index: main.c =================================================================== RCS file: /home/ncvs/src/usr.bin/systat/main.c,v retrieving revision 1.15 diff -u -d -r1.15 main.c --- main.c 25 May 2001 23:10:27 -0000 1.15 +++ main.c 10 Dec 2001 13:25:56 -0000 @@ -174,7 +174,7 @@ signal(SIGALRM, display); display(0); noecho(); - crmode(); + halfdelay(10); keyboard(); /*NOTREACHED*/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message