diff options
| author | Mateusz Guzik <mjg@FreeBSD.org> | 2025-10-04 02:20:37 +0000 |
|---|---|---|
| committer | Mateusz Guzik <mjg@FreeBSD.org> | 2025-10-04 02:20:37 +0000 |
| commit | 6cc493c79d9b9f8318c87d3d6bfd225924cc933b (patch) | |
| tree | c5344d0c0115f9d3b3ade5850afdb917f8fea251 | |
| parent | b11a5709ec2b61fefb03bfdd38e2f06d2c1107c1 (diff) | |
mtx: remove stale commentary about inlined spinlock ops
While both locking and unlocking a spinlock used to be inline, this
changed when spinlock_enter/spinlock_exit got introduced, defeating the
point of inlining them.
This either needs to have inlined spinlock enter/exit in place or have
mtx lock/unlock as function calls with the irq flags inlined in there.
Sponsored by: Rubicon Communications, LLC ("Netgate")
| -rw-r--r-- | sys/sys/mutex.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 08d4e2d28b33..b534a74626bc 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -246,10 +246,10 @@ void _thread_lock(struct thread *); }) /* - * Lock a spin mutex. For spinlocks, we handle recursion inline (it - * turns out that function calls can be significantly expensive on - * some architectures). Since spin locks are not _too_ common, - * inlining this code is not too big a deal. + * Lock a spin mutex. + * + * FIXME: spinlock_enter is a function call, defeating the point of inlining in + * this. */ #ifdef SMP #define __mtx_lock_spin(mp, tid, opts, file, line) __extension__ ({ \ @@ -317,10 +317,10 @@ void _thread_lock(struct thread *); }) /* - * Unlock a spin mutex. For spinlocks, we can handle everything - * inline, as it's pretty simple and a function call would be too - * expensive (at least on some architectures). Since spin locks are - * not _too_ common, inlining this code is not too big a deal. + * Unlock a spin mutex. + * + * FIXME: spinlock_exit is a function call, defeating the point of inlining in + * this. * * Since we always perform a spinlock_enter() when attempting to acquire a * spin lock, we need to always perform a matching spinlock_exit() when |
