Date: Mon, 10 Dec 2001 05:50:01 -0800 (PST) From: Sheldon Hearn <sheldonh@starjuice.net> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/32667: systat waste too much time reading input Message-ID: <200112101350.fBADo1m29579@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/32667; it has been noted by GNATS. From: Sheldon Hearn <sheldonh@starjuice.net> To: Bruce Evans <bde@zeta.org.au> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112101350.fBADo1m29579>