NetBSD Problem Report #28374
From www@netbsd.org Sun Nov 21 08:31:57 2004
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
id 51D042525D0; Sun, 21 Nov 2004 08:31:57 +0000 (UTC)
Message-Id: <20041121083157.51D042525D0@narn.netbsd.org>
Date: Sun, 21 Nov 2004 08:31:57 +0000 (UTC)
From: arto@selonen.org
Reply-To: arto@selonen.org
To: gnats-bugs@netbsd.org
Subject: vmstat(1) reports more pages freed by page daemon than actually are
X-Send-Pr-Version: www-1.0
>Number: 28374
>Category: bin
>Synopsis: vmstat(1) reports more pages freed by page daemon than actually are
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Nov 21 08:32:00 +0000 2004
>Originator: Arto Selonen
>Release: NetBSD 2.99.10 from ~20041109 sources
>Organization:
>Environment:
NetBSD blah 2.99.10 NetBSD 2.99.10 (BLAH) #74: Tue Nov 9 10:35:31 EET 2004 blah@blah:/obj/sys/arch/i386/compile/BLAH i386
>Description:
Running 'vmstat -s' produces (among other things):
1072242 pages freed by daemon
5059 anonymous pages scanned by daemon
706468 object pages scanned by daemon
Inspecting code of uvmpd_scan_inactive() in sys/uvm/uvm_pdaemon.c
reveals that the number of pages freed by the *page daemon*
can not be larger than the above anonymous+object pages scanned.
The discrepancy is caused by uvmexp.pdfreed (documented as
'/* number of pages daemon freed since boot */' in
/usr/src/sys/uvm/uvm_extern.h) being incremented by others
than page daemon (or what daemon is it referring to?). A quick grep
reveals that at least the following files seem to contain code
that increments the counter:
/usr/src/sys/uvm/uvm_pager.c
/usr/src/sys/miscfs/genfs/genfs_vnops.c
>How-To-Repeat:
Code inspection:
/usr/src/sys/uvm/uvm_extern.h
/usr/src/usr.bin/vmstat/vmstat.c
/usr/src/sys/uvm/uvm_pdaemon.c
/usr/src/sys/uvm/uvm_pager.c
Run 'vmstat -s', observe that 'pages freed by daemon' is larger
than what page daemon could have freed.
>Fix:
Either change the description of the counter in both uvm_extern.h and
vmstat.c (to eg. 'pages freed'), or use two counters (one for page daemon, one for others). Or describe which daemon is in question, if not page
daemon.
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.