Date: Sun, 5 Mar 2006 18:53:35 +0100 From: Divacky Roman <xdivac02@stud.fit.vutbr.cz> To: current@freebsd.org Subject: [PATCH]: small speedup to filedesc Message-ID: <20060305175335.GA40578@stud.fit.vutbr.cz>
next in thread | raw e-mail | index | archive | help
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 @@ -118,6 +118,7 @@ mtx_unlock(&(fd)->fd_mtx); \ } while (0) +#ifdef SMP #define FILEDESC_LOCK_FAST(fd) \ do { \ mtx_lock(&(fd)->fd_mtx); \ @@ -137,7 +138,10 @@ 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060305175335.GA40578>