From owner-freebsd-current@FreeBSD.ORG Sat Jul 29 23:39:09 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97F9F16A4DA for ; Sat, 29 Jul 2006 23:39:09 +0000 (UTC) (envelope-from mime@traveller.cz) Received: from ss.eunet.cz (ss.eunet.cz [193.85.228.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id C136443D5C for ; Sat, 29 Jul 2006 23:38:57 +0000 (GMT) (envelope-from mime@traveller.cz) Received: from localhost.i.cz (ss.eunet.cz [193.85.228.13]) by ss.eunet.cz (8.13.6/8.13.6) with ESMTP id k6TNcsm6074923 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sun, 30 Jul 2006 01:38:55 +0200 (CEST) (envelope-from mime@traveller.cz) From: Michal Mertl To: Paul Allen In-Reply-To: <20060729230214.GI12597@groat.ugcs.caltech.edu> References: <200607251254.k6PCsBef092737@lurza.secnetix.de> <200607271058.13055.jhb@freebsd.org> <20060728121525.GA44917@uk.tiscali.com> <200607280928.36573.jhb@freebsd.org> <20060728134701.GA45273@uk.tiscali.com> <20060728210154.GC748@turion.vk2pj.dyndns.org> <1154189612.1565.10.camel@genius.i.cz> <20060729205655.GE748@turion.vk2pj.dyndns.org> <20060729211530.GA50342@uk.tiscali.com> <1154212340.3609.18.camel@genius.i.cz> <20060729230214.GI12597@groat.ugcs.caltech.edu> Content-Type: text/plain Date: Sun, 30 Jul 2006 01:38:39 +0200 Message-Id: <1154216319.23616.23.camel@genius.i.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.6.2 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Peter Jeremy , freebsd-current@freebsd.org, Brian Candler Subject: Re: vmstat's entries type X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jul 2006 23:39:09 -0000 Paul Allen wrote: > Surely all you need to do is a cheap crit_enter,crit_exit > while updating the 64-bit per cpu counters. and on > a 64-bit arch you skip the crit_enter,crit_exit. Critical_enter/exit seem to be quite lightweight (single read/modify/write of a variable). > Seriously this is a bike shed. We can summarize it thus: > statistics should be maintained in 64-bit counters, these > counters should be per-cpu and consistent in that context, > nothing else should appear on the critical path. Why do you call it a bikesched? I think that your proposal could work but as nobody proposed doing the stuff with critical_* before, the thread may be fruitful. Is critical_* good enough protection though? What if two threads were updating the same per-CPU counter on the same CPU at the same time? With 64bits counter on a 32bit architecture? I expect the cache coherency issues are completely eliminated with per-CPU data, aren't they? I did not think of preventing the migration of the thread to different CPU before. I would have expected this was expensive operation... Michal