Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: locked hotplug scripts



On Wed, Mar 30, 2016 at 02:06:12PM +0200, Christoph Badura wrote:
> On Wed, Mar 30, 2016 at 01:33:00PM +0200, Manuel Bouyer wrote:
> > I did run an anita with 4 extra file-backed devices, without problems.
> 
> Cool. Very good.  Then I'll go with that version.
> 
> > > I've done my tests with 4, 5, and 10 virtual disks.  In part to check
> > > that the problems in port-xen/50659 have gone away.
> > 
> > Even with 5 disks, I've never been able to reproduce port-xen/50659
> > on my system. 
> 
> Really?  The unmodified block script would cause "xl create" to immediately
> bomb out because of it wanted to allocate the same vnd more than once.
> That was easily reproducible.

I guess it depends on various factors. The critical section isn't
that long and can be executed in less than 1/hz. But if you're unlucky it will
context-switch at the wrong place.

> 
> > AFAIK there's no reason to lock for so long. The xenstore can handle
> > multiple writes just fine.
> 
> Maybe the additional locking in the Linux version is because of
> xen-hotplug-cleanup.

Maybe, linux's script are more complex

> 
> > Also your version has a bug: if error() is called, the lock is released
> > twice, or you release a lock you didn't claim
> 
> Are you sure?  That's specifically what the test of "$_have_lock = 1" is
> for.  The lock needs to be released when the script exits, whether due to a
> signal or an "exit" statement.

I didn't pay attention to _have_lock.
But then the release_lock() just before error() is not needed (or
release_lock() in error() is not needed)

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index