[dm-devel] [PATCH 6/7] dm core: disable interrupt when taking map_lock

Hannes Reinecke hare at suse.de
Fri Apr 24 09:00:10 UTC 2009


Kiyoshi Ueda wrote:
> This patch disables interrupt when taking map_lock to prevent
> needless lockdep warnings in request-based dm.
> 
> request-based dm takes map_lock after taking queue_lock with
> disabling interrupt:
>   spin_lock_irqsave(queue_lock)
>   q->request_fn() == dm_request_fn()
>     => dm_get_table()
>          => read_lock(map_lock)
> while queue_lock could be taken in interrupt context.
> 
> So lockdep warns that a deadlock can happen:
>   write_lock(map_lock)
>   <interrupt>
>   spin_lock_irqsave(queue_lock)
>   q->request_fn() == dm_request_fn()
>     => dm_get_table()
>          => read_lock(map_lock)
> 
> Currently there is no such code path in request-based dm where
> q->request_fn() is called from interrupt context, so no such deadlock
> happens.
> But such warning messages confuse users, so prevent them by disabling
> interrupt when taking map_lock.
> 
> 
> Signed-off-by: Kiyoshi Ueda <k-ueda at ct.jp.nec.com>
> Signed-off-by: Jun'ichi Nomura <j-nomura at ce.jp.nec.com>
Acked-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare at suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)




More information about the dm-devel mailing list