Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jan 2005 14:45:46 +0100
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        Jeremie Le Hen <jeremie@le-hen.org>
Subject:   Re: cvs commit: src/sys/dev/md md.c
Message-ID:  <20050124134546.GB59685@obiwan.tataz.chchile.org>
In-Reply-To: <54109.1106552312@critter.freebsd.dk>
References:  <20050123190141.GQ36660@obiwan.tataz.chchile.org> <54109.1106552312@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
> Can you add some more yourself ?  We need to find out where Giant
> is lost, it is picked up here:
> 
>         case MD_VNODE:
>                 mtx_lock(&Giant);
>                 hasgiant = 1;
>                 break;
> 
> And only dropped again when we exit.
> 
> Somehow it gets lost on your machine and there is nothing but for us
> to find out where.
> 
> Can you try if you can reproduce it with WITNESS enabled  ?

First, I want to tell that I have triggered the panic even with
softupdates disabled.  When I first tried it, I thought the panic was
occuring immediately on creation of the first md(4) device, therefore
when I succeeded in creating /dev/md0 with a non-softupdates filesystem,
I believed this was related.

In fact, I think now it's clearly a race condition since the panic is
not reproducible in a deterministic way.  Sometimes it occurs on the
first creation of a md(4) device, sometimes I have to create up to
4 devices to get it triggered.

While talking about WITNESS, I checked my kernel config and remembered
that FULL_PREEMPTION is on.  The panic disappeared when I turned off
the latter : I managed to create up to about 16 md(4) devices.  I know
this should not be enabled for users, but I'm interested in "exposing
race conditions" as said in the comment.  I think you don't really have
time to fix this kind of bugs caused by FULL_PREEMPTION so I'll try
myself.  I'm sorry for wasting your time.

FYI, here is my kernel configuration:
%%%
  options         PREEMPTION
  options         FULL_PREEMPTION
  options         MUTEX_DEBUG
  options         KDB
  options         DDB
  options         INVARIANT_SUPPORT
  options         INVARIANTS
  options         DIAGNOSTIC
  options         WITNESS
  options         WITNESS_KDB
  
  options         SCHED_ULE
%%%

Following some advices from a friend of mine, I'm going to give a try
to the KTR tracing facility.  First I wanted to set a watchpoint on
Giant, but I've been told that this feature is not very efficient and
furthermore I'm dreading that Giant might be used many times a second.

Advices and help are of course welcome.
-- 
Jeremie Le Hen
jeremie@le-hen.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050124134546.GB59685>