[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [dm-devel] mirror patches - device failure detection/race fix/deadlock fix

On Tue, Aug 02, 2005 at 11:00:05AM -0500, Jon Brassow wrote:
> The 'race.patch' fixes a couple race conditions that were a result of 
> the __rh_alloc() function releasing and regrabbing a lock when called.

-       read_unlock(&rh->hash_lock);
-       nreg = mempool_alloc(rh->region_pool, GFP_NOIO);
+       nreg = mempool_alloc(rh->region_pool, GFP_ATOMIC);
        nreg->state = rh->log->type->in_sync(rh->log, region, 1) ?

So mempool_alloc is now called while holding a spinlock.
With GFP_ATOMIC, what happens if it returns NULL?
Doesn't it need to be able to sleep to get the benefit of the mempool?

> The 'deadlock.patch' switches all spin_lock calls on the region_lock to 
> spin_lock_irqsave.  Without this patch you machine will hang.
I'd prefer it if race.patch used the correct versions (with or without _irq).

agk redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]