There are three spin_lock functions in the kernel I am currently busy with.
I only find contributions covering only two of them (including Linux documentation).
Then answers or explanations are formulated ambigouos or contrary to each other or even contain comments saying the explanation is wrong. This makes it hard to get an overview.
Some basics are clear to me, as for example in interrupt context a simple spin_lock() can result in a deadlock. But I'd really appreciate a complete picture about this subject.
I need to understand:
- When should or we use which version, when shouldn't we?
- When is it not necessary to use a more safe version but doesn't hurt (except for performance)?
- What is the reason to use a version in a particular situation?