On 04/25/2016 01:01 AM, Hannes Reinecke wrote:
We cannot use an embedded mutex in a structure with reference
counting, as mutex unlock might be delayed, and the waiters
might then access an already freed memory area.
So convert it to a spinlock.
>
> For details cf https://lkml.org/lkml/2015/2/11/245
Hello Hannes,
Is what you describe a theoretical concern or have you observed any
issues that could have been caused by the rport mutex? I'm asking this
because my interpretation of the thread you refer to is different. My
conclusion is that it is safe to embed a mutex in a structure that uses
reference counting but that the mutex_unlock() call may trigger a
spurious wakeup. I think that the conclusion of that thread was that
glibc and kernel code should tolerate such spurious wakeups.
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html