From owner-freebsd-arch Wed Dec 26 11:59:11 2001 Delivered-To: freebsd-arch@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 8784337B41C; Wed, 26 Dec 2001 11:59:02 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id 339B781E0B; Wed, 26 Dec 2001 13:59:02 -0600 (CST) Date: Wed, 26 Dec 2001 13:59:02 -0600 From: Alfred Perlstein To: Mike Smith Cc: Michal Mertl , John Hanley , arch@freebsd.org Subject: Re: 64 bit counters Message-ID: <20011226135902.O91594@elvis.mu.org> References: <200112261947.fBQJliM01092@mass.dis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200112261947.fBQJliM01092@mass.dis.org>; from msmith@freebsd.org on Wed, Dec 26, 2001 at 11:47:44AM -0800 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Mike Smith [011226 13:40] wrote: > > On Tue, 25 Dec 2001, John Hanley wrote: > > > > Well I didn't think of that but I believe it shouldn't be that much a > > problem. At most the counter could become wrong :-). > > This would be completely unacceptable. Agreed. A lot of people think that a small window where data is inconsistant and exposed to other subsystems is acceptable. This is far from the truth, if a decision is made based on an incorrect counter or that incorrect counter value is then used in some critical function the entire system will obviously misbehave. This can have widespread and dire consequences. So it's not acceptable in the general case. One solution is to implement it correctly then add a knob to turn off the syncronization for those that want speed over correctness. They can poison their data if they so desire. sysctl kern.hardstats=1 stats_mtx_aquired = 0; if (hardstats) { mtx_lock(&stats_mtx); stats_mtx_aquired = 1; } update_stats(); if (stats_mtx_aquired) { mtx_unlock(&stats_mtx); } -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductable donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message