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
This commit is contained in:
parent
5ec7256cb1
commit
90e72822ac
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157565
@ -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 { \
|
||||
|
Loading…
Reference in New Issue
Block a user