[dm-devel] dm-snapshot: use mutex instead of rw-semaphore

Mikulas Patocka mpatocka at redhat.com
Fri Jan 5 22:52:20 UTC 2018



On Fri, 5 Jan 2018, Mike Snitzer wrote:

> On Thu, Nov 23 2017 at  4:15pm -0500,
> Mikulas Patocka <mpatocka at redhat.com> wrote:
> 
> > The rw-semaphore is acquired for read only on two places, none of them is
> > performance-critical. So, we can replace it with a mutex.
> 
> Can you expand on why you'd like to avoid using a rw_semaphore?  mutex
> being faster in the fast path?
> 
> Thanks,
> Mike

Mutex code is simpler. Mutex is used more often in the kernel than 
rw-semaphore, so using mutex causes less i-cache pollution.

Mikulas




More information about the dm-devel mailing list