Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jul 2007 19:04:31 +0200
From:      Ed Schouten <ed@fxq.nl>
To:        Jeff Roberson <jroberson@chesapeake.net>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: New SCHED_SMP diff.
Message-ID:  <20070702170431.GG77379@hoeg.nl>
In-Reply-To: <20070701224452.I552@10.0.0.1>
References:  <20070701224452.I552@10.0.0.1>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
* Jeff Roberson <jroberson@chesapeake.net> wrote:
> This diff also includes another patch that I intend to commit to current 
> which significantly improved write performance for mysql by removing all 
> 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=kern/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,
-- 
 Ed Schouten <ed@fxq.nl>
 WWW: http://g-rave.nl/

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD4DBQFGiTAf52SDGA2eCwURAn6cAJi6O+DPFIAQJb6o/jpuy49eruM8AJ9Co9m4
8AuCi3j8Pp8DhU1xO2jZGA==
=AiT/
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070702170431.GG77379>