参照元†
- FIXME: これは何?
- BKL(Big Kernel Lock)のロック関数の本体
- 1回目のロック: __lock_kernel() を呼んで、
BKL 用のスピンロックなどを獲得する
- 2回目以降のロック: ロックカウントを加算する
- const char *func
- const char *file
- int line
返り値†
/*
* Getting the big kernel lock.
*
* This cannot happen asynchronously, so we only need to
* worry about other CPU's.
*/
void __lockfunc _lock_kernel(const char *func, const char *file, int line)
{
int depth = current->lock_depth + 1;
trace_lock_kernel(func, file, line);
if (likely(!depth)) {
- 初回のロック(BKL のネスト数が負数 -> 0)の場合、
ロック処理を実行する。
might_sleep();
__lock_kernel();
}
current->lock_depth = depth;
}
(略)
EXPORT_SYMBOL(_lock_kernel);
コメント†