From owner-freebsd-stable@FreeBSD.ORG Thu May 1 01:13:49 2008 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71466106564A for ; Thu, 1 May 2008 01:13:49 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from proxy.meer.net (proxy.meer.net [64.13.141.13]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0F98FC12 for ; Thu, 1 May 2008 01:13:49 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from mail.meer.net (mail.meer.net [64.13.141.3]) by proxy.meer.net (8.14.2/8.14.2) with ESMTP id m411DmWK044478 for ; Wed, 30 Apr 2008 18:13:48 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from mail2.meer.net (mail2.meer.net [64.13.141.16]) by mail.meer.net (8.13.3/8.13.3/meer) with ESMTP id m411Ddam066664 for ; Wed, 30 Apr 2008 18:13:39 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from minion.local.neville-neil.com (c24-143-66-45.sea2.cablespeed.com [24.143.66.45] (may be forged)) (authenticated bits=0) by mail2.meer.net (8.14.1/8.14.1) with ESMTP id m411DdAL008164 for ; Wed, 30 Apr 2008 18:13:39 -0700 (PDT) (envelope-from gnn@neville-neil.com) Date: Wed, 30 Apr 2008 18:13:34 -0700 Message-ID: From: gnn@freebsd.org To: stable@freebsd.org User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.1.50 (i386-apple-darwin8.11.1) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Canit-CHI2: 0.50 X-Bayes-Prob: 0.5 (Score 0, tokens from: ) X-Spam-Score: 0.10 () [Tag at 5.00] COMBINED_FROM X-CanItPRO-Stream: default X-Canit-Stats-ID: 182083 - 3dd1a54a8435 X-Scanned-By: CanIt (www . roaringpenguin . com) on 64.13.141.13 Cc: Subject: Some odd behaviour of vmstat and vmtotal... X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2008 01:13:49 -0000 Howdy, In deploying 7.0 at work we were finding a persistent problem when running "vmstat 1" on systems. The problem shows up as a 10ms "pause" in processing, usually packet stamping and forwarding by a user level process. This is due to the fact that vmstat calls the vmtotal() routine which in turn does a whole lot of locking. The vmtotal call locks and walks the VM object list twice in a mark and sweep operation. So, the question is, "What is the right way to fix this?" I could remove the locking since the O_ACTIVE bit is not used by any other routine besides vmtotal, but I'm not too happy about that. The relevant code can be found in src/sys/vm/vm_meter.c in vmtotal(). Thoughts? Best, George