From owner-freebsd-current@FreeBSD.ORG Sun Mar 5 17:53:41 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B43516A420; Sun, 5 Mar 2006 17:53:41 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BFC743D45; Sun, 5 Mar 2006 17:53:39 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.4/8.13.3) with ESMTP id k25HrZSB041324 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 5 Mar 2006 18:53:36 +0100 (CET) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.4/8.13.3/Submit) id k25HrZml041323; Sun, 5 Mar 2006 18:53:35 +0100 (CET) Date: Sun, 5 Mar 2006 18:53:35 +0100 From: Divacky Roman To: current@freebsd.org Message-ID: <20060305175335.GA40578@stud.fit.vutbr.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.49 on 147.229.10.14 Cc: Subject: [PATCH]: small speedup to filedesc X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2006 17:53:41 -0000 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