On 15.02.2022 17:28, Oleksandr Andrushchenko wrote: > On 15.02.22 18:18, Jan Beulich wrote: >> On 15.02.2022 16:46, Oleksandr Andrushchenko wrote: >>> Question: can anyone please explain why pcidevs is a recursive lock? >> Well, assuming you did look at the change making it so, can you be a >> little more specific with your question? Are you perhaps suggesting >> the original reason has disappeared, and no new one has appeared? I'm >> afraid I have to repeat what I did say before: If you want to remove >> the recursive nature of the lock, then it is all on you to prove that >> there's no code path where the lock is taken recursively. IOW even if >> no-one knew of a reason, you'd still need to provide this proof. >> Unless of course we'd all agree we're okay to take the risk; I don't >> see us doing so, though. > The question was exactly as asked: I don't understand why it is > recursive and for what reason. I am not suggesting we blindly > change it to a normal spinlock.
But the reason for changing it to be recursive is stated in the description of the respective commit bfa493f52e89: IOMMU: make the pcidevs_lock a recursive one The pcidevs_lock is going to be recursively taken for hiding ATS device, when VT-d Device-TLB flush timed out. Before asking such a question, I would have assumed that you looked up that very commit. Hence my asking to be more specific. Jan