Re: [PATCH] a deadlock bug in the kernel-side device mapper code

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

 



On Fri, 6 Nov 2009, Alasdair G Kergon wrote:

> On Thu, Nov 05, 2009 at 09:58:26PM -0500, Mikulas Patocka wrote:
> > +static DEFINE_MUTEX(_name_read_lock);
> 
> Any reason for a mutex rather than a spinlock?

There can be both. I basically use the rule "if there can be either 
spinlock or mutex, use mutex". Because mutexes don't create scheduling 
latency --- i.e. you don't have to check them "how much time can it spend 
inside a mutex and how to break a long lock into few smaller locks".

Performance of mutex and spinlock in non-contended case is the same.

Mikulas

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux