Re: kvm_open errors on /proc/*/mem in top

2011-06-10 Thread Sergey Kandaurov
On 10 June 2011 00:01, Jim Bryant  wrote:
> i'm not sure which list this belongs to, so i'm posting to -hackers and
> -stable.
>
> i've noticed for a while now that during heavy activity (for instance
> buildworld), that top will get these kvm_read errors when reading proc
> mem entries.

Hi.
I think that is a question of whether it's acceptable to hide all errors
originated in kvm(3):

Index: usr.bin/top/machine.c
===
--- usr.bin/top/machine.c   (revision 222893)
+++ usr.bin/top/machine.c   (working copy)
@@ -265,7 +265,7 @@
else if (namelength > UPUNAMELEN)
namelength = UPUNAMELEN;

-   kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open");
+   kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, NULL);
if (kd == NULL)
return (-1);

Or rewrite top(1) a little more to open kvm with kvm_openfiles(), to let
the caller decide itself in what places it needs to print an error with
kvm_geterr().

>
> i have included a screenshot of what happens during such events...
>
> last pid: 92024;  load averages:  4.79,  4.58,
> 4.10
> up 0+00:49:07  15:30:53
> 225 processes: 10 running, 197 sleeping, 18 waiting
> CPU: 90.6% user,  0.0% nice,  9.4% system,  0.0% interrupt,  0.0% idle
> Mem: 493M Active, 1337M Inact, 604M Wired, 632K Cache, 315M Buf, 524M Free
> Swap: 4097M Total, 4097M Free
> kvm_open: cannot open /proc/86755/mem
>  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
> 91943 root          1  97    0 39536K 33620K RUN     1   0:01  7.37%
> [cc1plus]
> 2859 jbryant       1  48    0   406M 72332K select  0   3:10  5.96%
> kwin -session 1028b2382461f50001270420560001955_13
> 2747 root          1  46    0   419M   370M select  0   1:43  4.39%
> /usr/local/bin/X :0 -nolisten tcp -auth /var/run/xauth/A:0
> 1464 root          1  44    0  8068K  1384K select  0   0:03  0.39%
> /usr/sbin/moused -p /dev/ums0 -t auto -I /var/run/moused.u
> 11219 jbryant       7  44    0   299M   109M select  1   0:17  0.29%
> /usr/local/lib/thunderbird/thunderbird-bin
> 2865 jbryant       1  45    0   453M 86140K select  0   0:21  0.20%
> kdeinit4: kdeinit4: plasma-desktop (kdeinit4)
> 2882 jbryant       1  44    0   391M 60996K select  0   0:17  0.10%
> kdeinit4: kdeinit4: kmix -session 102511e52251c60001304471
> 92001 root          1  97    0 23452K 22256K CPU1    1   0:00  0.00% [cc1]
> 92017 root          1  96    0 16172K 13440K RUN     0   0:00  0.00% [cc1]
>
[snip]

-- 
wbr,
pluknet
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


kvm_open errors on /proc/*/mem in top

2011-06-09 Thread Jim Bryant

i'm not sure which list this belongs to, so i'm posting to -hackers and
-stable.

i've noticed for a while now that during heavy activity (for instance
buildworld), that top will get these kvm_read errors when reading proc
mem entries.

i have included a screenshot of what happens during such events...

last pid: 92024;  load averages:  4.79,  4.58,
4.10
up 0+00:49:07  15:30:53
225 processes: 10 running, 197 sleeping, 18 waiting
CPU: 90.6% user,  0.0% nice,  9.4% system,  0.0% interrupt,  0.0% idle
Mem: 493M Active, 1337M Inact, 604M Wired, 632K Cache, 315M Buf, 524M Free
Swap: 4097M Total, 4097M Free
kvm_open: cannot open /proc/86755/mem
 PID USERNAMETHR PRI NICE   SIZERES STATE   C   TIME   WCPU COMMAND
91943 root  1  970 39536K 33620K RUN 1   0:01  7.37%
[cc1plus]
2859 jbryant   1  480   406M 72332K select  0   3:10  5.96%
kwin -session 1028b2382461f50001270420560001955_13
2747 root  1  460   419M   370M select  0   1:43  4.39%
/usr/local/bin/X :0 -nolisten tcp -auth /var/run/xauth/A:0
1464 root  1  440  8068K  1384K select  0   0:03  0.39%
/usr/sbin/moused -p /dev/ums0 -t auto -I /var/run/moused.u
11219 jbryant   7  440   299M   109M select  1   0:17  0.29%
/usr/local/lib/thunderbird/thunderbird-bin
2865 jbryant   1  450   453M 86140K select  0   0:21  0.20%
kdeinit4: kdeinit4: plasma-desktop (kdeinit4)
2882 jbryant   1  440   391M 60996K select  0   0:17  0.10%
kdeinit4: kdeinit4: kmix -session 102511e52251c60001304471
92001 root  1  970 23452K 22256K CPU11   0:00  0.00% [cc1]
92017 root  1  960 16172K 13440K RUN 0   0:00  0.00% [cc1]


and such as this:

last pid: 19348;  load averages:  1.03,  1.93,
2.84
up 1+04:42:07  15:31:37
201 processes: 4 running, 178 sleeping, 19 waiting
CPU: 47.4% user,  0.0% nice,  3.4% system,  0.0% interrupt, 49.3% idle
Mem: 318M Active, 2400M Inact, 679M Wired, 1948K Cache, 407M Buf, 428M Free
Swap: 8192M Total, 6488K Used, 8186M Free
kvm_open: cannot open /proc/1141/memm
kvm_open: cannot open /proc/92606/memRES STATE   C   TIME   WCPU COMMAND
  10 root  2 171 ki31 0K32K RUN 0  55.9H 103.81% [idle]
19344 root  1  960 17188K 14300K CPU10   0:00  0.00% [cc1]
19341 root  1  760  3204K  1068K select  1   0:00  0.00%
make all DIRPRFX=fdc/
19342 root  1  760  8340K  1848K wait1   0:00  0.00% sh -ev
19343 root  1  760  3204K   596K wait0   0:00  0.00% [cc]
19345 root  1  760  3204K  1292K piperd  0   0:00  0.00%
/usr/obj/usr/src/tmp/usr/bin/as -Qy -o fdc.o

the current fix for this is to [CTRL]-L.

i assume that what is happening is that top just loosing track of what's
running, and the procs are dead by the time it tries to read them, or
that the proc ends during top reading.

is there any way to fix this?  it's annoying as f&#k.


ps: running 8-STABLE.


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"