NetBSD Problem Report #54102
From www@netbsd.org Sat Apr 6 11:43:03 2019
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 576D37A154
for <gnats-bugs@gnats.NetBSD.org>; Sat, 6 Apr 2019 11:43:03 +0000 (UTC)
Message-Id: <20190406114302.485557A1A4@mollari.NetBSD.org>
Date: Sat, 6 Apr 2019 11:43:02 +0000 (UTC)
From: n54@gmx.com
Reply-To: n54@gmx.com
To: gnats-bugs@NetBSD.org
Subject: Multiple values from "vmstat -s" are broken
X-Send-Pr-Version: www-1.0
>Number: 54102
>Category: kern
>Synopsis: Multiple values from "vmstat -s" are broken
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Apr 06 11:45:00 +0000 2019
>Last-Modified: Sat Apr 06 21:10:01 +0000 2019
>Originator: Kamil Rytarowski
>Release: 8.99.36
>Organization:
TNF
>Environment:
NetBSD chieftec 8.99.36 NetBSD 8.99.36 (GENERIC) #6: Wed Apr 3 20:00:45 CEST 2019 root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC amd64
>Description:
Multiple values from "vmstat -s" are unreliable and appear to overflow.
E.g.
18446744073091529768 pagealloc desired color avail
18446744072282190447 pagealloc desired color not avail
>How-To-Repeat:
vmstat -s
Especially against some benchmarking tools and on multiprocessor longer running machines (30+ days).
>Fix:
Reflect the tool with reality of the current hardware.
>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: kern/54102: Multiple values from "vmstat -s" are broken
Date: Sat, 6 Apr 2019 18:20:19 -0000 (UTC)
n54@gmx.com writes:
>Multiple values from "vmstat -s" are unreliable and appear to overflow.
>E.g.
>18446744073091529768 pagealloc desired color avail
>18446744072282190447 pagealloc desired color not avail
The kernel uses a signed 'int' to count such events, reports these
as signed 'int64_t' and vmstat prints them as u64. That's true
for a large number of values in uvmextern.
Changing this to use unsigned would be the first thing to do.
64bit values may not be atomic enough on some architectures.
--
--
Michael van Elst
Internet: mlelstv@serpens.de
"A potential Snark may lurk in every tree."
From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: kern/54102: Multiple values from "vmstat -s" are broken
Date: Sat, 6 Apr 2019 23:08:36 +0200
On 06.04.2019 20:25, Michael van Elst wrote:
> The following reply was made to PR kern/54102; it has been noted by GNAT=
S.
>
> From: mlelstv@serpens.de (Michael van Elst)
> To: gnats-bugs@netbsd.org
> Cc:
> Subject: Re: kern/54102: Multiple values from "vmstat -s" are broken
> Date: Sat, 6 Apr 2019 18:20:19 -0000 (UTC)
>
> n54@gmx.com writes:
>
> >Multiple values from "vmstat -s" are unreliable and appear to overflow=
.
> >E.g.
> >18446744073091529768 pagealloc desired color avail
> >18446744072282190447 pagealloc desired color not avail
>
> The kernel uses a signed 'int' to count such events, reports these
> as signed 'int64_t' and vmstat prints them as u64. That's true
> for a large number of values in uvmextern.
>
> Changing this to use unsigned would be the first thing to do.
> 64bit values may not be atomic enough on some architectures.
>
>
These numbers rather don't need to be super accurate, it just matters to
reflect the state. Right now part of the values look random and they
aren't useful for any benchmarking.
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.