diff options
author | Attilio Rao <attilio@FreeBSD.org> | 2012-12-09 04:54:22 +0000 |
---|---|---|
committer | Attilio Rao <attilio@FreeBSD.org> | 2012-12-09 04:54:22 +0000 |
commit | e68ccbe85eedeaba3b4026cd96289af8bb00cc28 (patch) | |
tree | 3cb84ac1cacb4ad4963cf0e7cdbdf19c56c486fb | |
parent | 25b5bb4c1b8bdfcb6d11dfdc5041bc9ece7a0395 (diff) |
Notes
-rw-r--r-- | sys/kern/kern_switch.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 885dc22cea76..d0009b1042f3 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -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) |