[PATCH]: small speedup to filedesc

From: Divacky Roman <xdivac02_at_stud.fit.vutbr.cz>
Date: Sun, 5 Mar 2006 18:53:35 +0100
hi

this:

Index: filedesc.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/filedesc.h,v
retrieving revision 1.73
diff -u -r1.73 filedesc.h
--- filedesc.h	14 Sep 2005 14:57:04 -0000	1.73
+++ filedesc.h	5 Mar 2006 17:48:19 -0000
_at__at_ -118,6 +118,7 _at__at_
 		mtx_unlock(&(fd)->fd_mtx);						\
 	} while (0)
 
+#ifdef	SMP
 #define	FILEDESC_LOCK_FAST(fd)								\
 	do {										\
 		mtx_lock(&(fd)->fd_mtx);						\
_at__at_ -137,7 +138,10 _at__at_
 			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 {										\

leads to: 

Difference at 95.0% confidence
        -39.6 +/- 10.473
	-3.40031% +/- 0.899276%
	(Student's t, pooled s = 14.0046)

in a benchmark which basically fstat()es /dev/ttyv[0-9] (its available on
hysteria.sk/~neologism/filedesc.tar)

the patch was discussed with Suleiman Souhlal

roman
Received on Sun Mar 05 2006 - 16:53:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:53 UTC