Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Feb 2008 13:39:15 +0000
From:      Dieter <freebsd@sopwith.solgatos.com>
To:        "Steven Hartland" <killing@multiplay.co.uk>
Cc:        freebsd-performance@freebsd.org
Subject:   Re: newfs locks entire machine for 20seconds 
Message-ID:  <200802012139.VAA00426@sopwith.solgatos.com>
In-Reply-To: Your message of "Fri, 01 Feb 2008 13:57:09 GMT." <018701c864da$57020f20$b6db87d4@multiplay.co.uk> 

next in thread | previous in thread | raw e-mail | index | archive | help
> >> Wait - if it returns EAGAIN for a while, then look at that code above. 
> >> It will hold the sysctl lock for some indefinite amount of time.  Maybe 
> >> it should look like this instead:
> >> 
> >> 
> >>    do {
> >>        SYSCTL_LOCK();
> >>        req.oldidx = 0;
> >>        req.newidx = 0;
> >>        error = sysctl_root(0, name, namelen, &req);
> >>        SYSCTL_UNLOCK();
> >>    } while (error == EAGAIN);
> >> 
> >>    if (req.lock == REQ_WIRED && req.validlen > 0)
> >>        vsunlock(req.oldptr, req.validlen);
> >> 
> > 
> > Tried no difference unfortunately, possibly its give the closeness
> > of the lock unlock its just reacquiring the lock straight after releasing
> > it hence not giving the other thread chance to run / obtain the lock?
> 
> In an attempt to prove this is in fact the issue I've tried with the
> locking around this code removed, yes dangerous but just as a test :)
> It does indeed prevent the extended lockup so this is the right area.

Would adding a call to cpu_switch() be appropriate here?



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