From owner-freebsd-current@FreeBSD.ORG Tue Apr 6 09:01:11 2004 Return-Path: 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 3B4FB16A4CE for ; Tue, 6 Apr 2004 09:01:11 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA51543D31 for ; Tue, 6 Apr 2004 09:01:10 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i36G0TPq011961; Tue, 6 Apr 2004 12:00:29 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i36G0SAU011958; Tue, 6 Apr 2004 12:00:28 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Tue, 6 Apr 2004 12:00:28 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Andy Farkas In-Reply-To: <20040406174155.S56300@hewey.af.speednet.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Artem Koutchine cc: freebsd-current@freebsd.org Subject: Re: Qustion about being "Giant-locked" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 06 Apr 2004 16:01:11 -0000 On Tue, 6 Apr 2004, Andy Farkas wrote: > On Tue, 6 Apr 2004, Xin LI wrote: > > On Tue, Apr 06, 2004 at 11:03:13AM +0400, Artem Koutchine wrote: > > > While booting i see many drivers marked > > > as [Giant-locked]. > > > Is being Giant-locked good or bad what are the > > > implications? > > It's not good if you have a computer with multiple processors. > > I have a box with 4 ppro-200 cpus. It has 4 adaptec eisa scsi controllers, > each controlling 2 disks. All 8 disks are in the same vinum raid-5 volume. > I have a large (1.5gig) file on this volume. > > This is what happens when I run md5 on this file 4 times concurrently: ... > As you can see, only 8% of all cpus are being used to calculate the md5s. > At least 2 cpus are constantly idle. That's probably because you're mostly waiting on disks and have blindingly fast CPUs. However, we have some tools to help diagnose lock contention -- in particular, you can turn on options MUTEX_PROFILING (see the man page for details) and measure which locks are being contended. If your theory is right, you should see lots of contention between grabbing Giant in the SCSI layer during interrupts, and grabbing Giant on the way into the file system code in VFS. If you theory is wrong, there won't be lots of contention there. Even if your theory is wrong, you'll probably see a bit of contention, but not as much. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research