Received: by mail.netbsd.org (Postfix, from userid 605) id ABE0D84E51; Thu, 30 Nov 2017 14:31:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 3507C84DF9 for ; Thu, 30 Nov 2017 14:31: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 F2YCMMuBALWu for ; Thu, 30 Nov 2017 14:31:04 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id C12F484D31 for ; Thu, 30 Nov 2017 14:31:04 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 9D281FB40; Thu, 30 Nov 2017 14:31:04 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Thu, 30 Nov 2017 14:31:04 +0000 From: "Martin Husemann" Subject: CVS commit: [netbsd-8] src/sys To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20171130143104.9D281FB40@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Martin Husemann" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: martin Date: Thu Nov 30 14:31:04 UTC 2017 Modified Files: src/sys/kern [netbsd-8]: subr_localcount.c src/sys/sys [netbsd-8]: localcount.h Log Message: Pull up following revision(s) (requested by ozaki-r in ticket #404): sys/sys/localcount.h: revision 1.5 sys/kern/subr_localcount.c: revision 1.7 Implement a debugging facility (overflow/underflow detection) for localcount We cannot get an accurate count from a localcount instance because it consists of per-cpu counters and we have no way to sum them up atomically. So we cannot detect counter overflow/underflow as we can do on a normal refcount. The facility adds an atomic counter to each localcount instance to enable the validations. The counter ups and downs in synchronization with the per-CPU counters. The counter is used iff both DEBUG and LOCKDEBUG are enabled in the kernel. Discussed on tech-kern@ To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/kern/subr_localcount.c cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/sys/localcount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.