Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Apr 2004 12:00:28 -0400 (EDT)
From:      Robert Watson <rwatson@freebsd.org>
To:        Andy Farkas <andyf@speednet.com.au>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Qustion about being "Giant-locked"
Message-ID:  <Pine.NEB.3.96L.1040406115756.11647C-100000@fledge.watson.org>
In-Reply-To: <20040406174155.S56300@hewey.af.speednet.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040406115756.11647C-100000>