mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 09:11:07 -04:00
Add a comment on why inlining critical_enter() may not be a good idea
for the general case. Reviewed by: bde MFC after: 1 week
This commit is contained in:
parent
25b5bb4c1b
commit
e68ccbe85e
1 changed files with 6 additions and 0 deletions
|
|
@ -176,6 +176,12 @@ retry:
|
|||
/*
|
||||
* Kernel thread preemption implementation. Critical sections mark
|
||||
* regions of code in which preemptions are not allowed.
|
||||
*
|
||||
* It might seem a good idea to inline critical_enter() but, in order
|
||||
* to prevent instructions reordering by the compiler, a __compiler_membar()
|
||||
* would have to be used here (the same as sched_pin()). The performance
|
||||
* penalty imposed by the membar could, then, produce slower code than
|
||||
* the function call itself, for most cases.
|
||||
*/
|
||||
void
|
||||
critical_enter(void)
|
||||
|
|
|
|||
Loading…
Reference in a new issue