diff options
author | ssouhlal <ssouhlal@FreeBSD.org> | 2006-04-06 16:27:48 +0000 |
---|---|---|
committer | ssouhlal <ssouhlal@FreeBSD.org> | 2006-04-06 16:27:48 +0000 |
commit | 48062565def6f202e877dafe111cc5836f4b71b7 (patch) | |
tree | 76b6532a193e67df4905789c3b43b10f31acb9e3 /sys | |
parent | 8694646e12362cd4a91d044f6e8061aa8d0573a6 (diff) | |
download | FreeBSD-src-48062565def6f202e877dafe111cc5836f4b71b7.zip FreeBSD-src-48062565def6f202e877dafe111cc5836f4b71b7.tar.gz |
Replace FILEDESC_[UN]LOCK_FAST() with a critical section on UP.
Gives a small but measurable performance improvement.
Submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
MFC after: 1 month
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/filedesc.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 661fa5e..9ef3e48 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -118,6 +118,7 @@ struct filedesc_to_leader { mtx_unlock(&(fd)->fd_mtx); \ } while (0) +#ifdef SMP #define FILEDESC_LOCK_FAST(fd) \ do { \ mtx_lock(&(fd)->fd_mtx); \ @@ -137,7 +138,10 @@ struct filedesc_to_leader { wakeup(&(fd)->fd_locked); \ mtx_unlock(&(fd)->fd_mtx); \ } while (0) - +#else +#define FILEDESC_LOCK_FAST(fdp) critical_enter() +#define FILEDESC_UNLOCK_FAST(fdp) critical_exit() +#endif /* SMP */ #ifdef INVARIANT_SUPPORT #define FILEDESC_LOCK_ASSERT(fd, arg) \ do { \ |