NetBSD Problem Report #6891
Received: (qmail 14711 invoked from network); 27 Jan 1999 21:33:47 -0000
Message-Id: <199901272133.WAA25902@gnyf.t.dk>
Date: Wed, 27 Jan 1999 22:33:45 +0100 (CET)
From: "Soren S. Jorvang" <soren@t.dk>
Reply-To: soren@t.dk
To: gnats-bugs@gnats.netbsd.org
Cc: soren@t.dk
Subject: garbage memory usage fields in proc structures of kernel threads
X-Send-Pr-Version: 3.95
>Number: 6891
>Category: kern
>Synopsis: garbage memory usage fields in proc structures of kernel threads
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jan 27 13:35:00 +0000 1999
>Closed-Date: Thu Aug 05 05:39:00 +0000 1999
>Last-Modified: Thu Aug 05 05:39:13 +0000 1999
>Originator: Soren S. Jorvang
>Release: NetBSD-current 19980127
>Organization:
Soren
>Environment:
System: NetBSD meow 1.3I i386
>Description:
Memory usage fields in the proc structures of kernel threads appear uninitialized.
I vaguely seem to recall that this was due to some unfinished work.
For now, I suggest just zeroing those fields.
>How-To-Repeat:
$ ps axu
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
soren 1396 0.0 0.4 364 224 p1 R+ 10:27PM 0:00.00 ps -axu
root 1 0.0 0.3 332 212 ?? Ss 7:55PM 0:00.03 /sbin/init -s
root 2 0.0 -34.3 0 -22360 ?? DL 7:55PM 0:00.11 (pagedaemon)
root 3 0.0 -34.3 0 -22360 ?? DL 7:55PM 0:00.04 (reaper)
[...]
root 0 0.0 -34.3 0 -22372 ?? DLs 7:55PM 0:00.00 (swapper)
>Fix:
Don't know.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed
State-Changed-By: simonb
State-Changed-When: Sun Feb 28 02:08:26 PST 1999
State-Changed-Why:
From Chuck Cranor on tech-kern:
> i looked at this on the i386 a while back but i haven't had
> time to figure out how to fix it. the problem on the i386 is that
> pmap_kenter() adds kernel mappings without bumping up the kernel
> pmap's pm_stats.resident_count [it can't bump it as-is because
> it doesn't have a lock on the kernel pmap's simplelock.]
>
> then, later when mappings established with pmap_kenter() are
> removed by pmap_remove() it subtracts off resident_count irrespective
> of if it was bumped up by pmap_enter() or not. so, one soultion
> would be to change these functions to always adjust resident_count.
> another solution could be to change it so that resident_count doesn't
> change for things entered with pmap_kenter().
>
> the thing that confuses me is you are seeing this on the mips
> and pmap_kenter is a PMAP_NEW thing that i've been playing with.
> if you are getting negative numbers without PMAP_NEW then there must
> be something somewhere that is entering PTE-level mappings into the
> pmap without bumping up resident_count?
Adding a hack to `ps' is not the "correct" way to fix this.
State-Changed-From-To: analyzed->closed
State-Changed-By: thorpej
State-Changed-When: Wed Aug 4 22:39:00 PDT 1999
State-Changed-Why:
This has been fixed.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.