Skip to content

Commit

Permalink
Replace FILEDESC_[UN]LOCK_FAST() with a critical section on UP.
Browse files Browse the repository at this point in the history
Gives a small but measurable performance improvement.

Submitted by:	Divacky Roman <xdivac02@stud.fit.vutbr.cz>
MFC after:	1 month
  • Loading branch information
repppie committed Apr 6, 2006
1 parent 8694646 commit 4806256
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sys/sys/filedesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand All @@ -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 { \
Expand Down

0 comments on commit 4806256

Please sign in to comment.