Documenting and enforcing locking requirements
Posted Jul 20, 2002 14:53 UTC (Sat) by
corbet (editor, #1)
In reply to:
Documenting and enforcing locking requirements by Lorenzo
Parent article:
Documenting and enforcing locking requirements
I hate to say it, but your author is not entirely clueless.
In this case, there are many kernel functions that expect to be called with specific locks already held. Yes, the lock is protecting data (or hardware resources, etc.), but the function needs to have access to said data. If a function tries to take out a lock that the thread already holds, it will spin for, shall we say, a very long time. There could also be a problem with lock ordering requirements.
Thus, "locks held" is part of the interface to a Linux kernel function whether you like it or not.
(
Log in to post comments)