From owner-freebsd-current@FreeBSD.ORG Mon Jul 2 17:04:33 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C528116A4C1 for ; Mon, 2 Jul 2007 17:04:33 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [83.98.131.211]) by mx1.freebsd.org (Postfix) with ESMTP id 35C0713C4BD for ; Mon, 2 Jul 2007 17:04:33 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 1D3F31CC2E; Mon, 2 Jul 2007 19:04:31 +0200 (CEST) Date: Mon, 2 Jul 2007 19:04:31 +0200 From: Ed Schouten To: Jeff Roberson Message-ID: <20070702170431.GG77379@hoeg.nl> References: <20070701224452.I552@10.0.0.1> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="y0Ed1hDcWxc3B7cn" Content-Disposition: inline In-Reply-To: <20070701224452.I552@10.0.0.1> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: FreeBSD Current Subject: Re: New SCHED_SMP diff. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: FreeBSD Current List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2007 17:04:33 -0000 --y0Ed1hDcWxc3B7cn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Jeff Roberson wrote: > This diff also includes another patch that I intend to commit to current= =20 > which significantly improved write performance for mysql by removing all= =20 > use of Giant in fcntl(). Some time ago I filed a PR that F_DUPFD performs a lot of useless locking. It first performs lookups of the descriptor to make sure it exists, but afterwards it just calls do_dup(), which does the lookups again. The patch shaves off a pair of FILEDESC_XLOCK/FILEDESC_XUNLOCK and PROC_LOCK/PROC_UNLOCK calls. http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/105346 http://g-rave.nl/junk/freebsd-kern_descrip.diff The only reason why F_DUPFD performs these checks, is because it could return EINVAL in some cases, while dup() and dup2() only return EMFILE and EBADFD. This patch makes do_dup() return EINVAL when the offset is invalid, so that's why the dup()/dup2() syscalls are changed as well. Yours, --=20 Ed Schouten WWW: http://g-rave.nl/ --y0Ed1hDcWxc3B7cn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD4DBQFGiTAf52SDGA2eCwURAn6cAJi6O+DPFIAQJb6o/jpuy49eruM8AJ9Co9m4 8AuCi3j8Pp8DhU1xO2jZGA== =AiT/ -----END PGP SIGNATURE----- --y0Ed1hDcWxc3B7cn--