Thread (4 messages) 4 messages, 2 authors, 2016-02-25

Mutex and Spinlock locked together

From: Devesh Sharma <hidden>
Date: 2016-02-25 09:23:43

Hi

In running kernel there are many places you can look to get the usage. But
the bottom line is

* You can take a spinlock under a mutex. e.g.
mutex_lock--->spinlock-----critical section-----spinunlock--->mutex_unlock.

* You can not take a mutex under a spinlock. e.g. spinlock--->mutex_lock
-----critical section ....mutex_unlock---->spinunlock is not allowed.


On Thu, Feb 25, 2016 at 11:37 AM, priyaranjan [off-list ref]
wrote:
Hello All,

Do you have any idea of a situation where we would need mutex and spinlock
to be locked together? I think there is an example for this in Linux
kernel. Can anyone help me?

Regards,
Priyaranjan

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-- 
Please don't print this E- mail unless you really need to - this will
preserve trees on planet earth.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160225/1c1c8011/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help