Received: by mail.netbsd.org (Postfix, from userid 605) id 95F3E84ED2; Sat, 24 Jul 2021 13:42:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id C943D84E92 for ; Sat, 24 Jul 2021 13:42:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id FACpY2sr3uEO for ; Sat, 24 Jul 2021 13:42:05 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 6022484D1F for ; Sat, 24 Jul 2021 13:42:05 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 52BFBFA95; Sat, 24 Jul 2021 13:42:05 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sat, 24 Jul 2021 13:42:05 +0000 From: "Simon Burge" Subject: CVS commit: src/usr.bin/systat To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20210724134205.52BFBFA95@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Simon Burge" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: simonb Date: Sat Jul 24 13:42:05 UTC 2021 Modified Files: src/usr.bin/systat: vmstat.c Log Message: Instead of getting an estimate of the number of kernel buffers, allocating memory for them, requesting all the metadata contents of these buffers (and repeating in the unlikely case of the number of buffers increasing too much since the estimate) and then straight away throwing all the contents out just to count how many buffers there were, just get the initial estimate from the kernel and subtract the slop. Reduces system CPU usage of "systat vm" by approx 80% for any system with a reasonable number of buffers. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/usr.bin/systat/vmstat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.