From owner-svn-src-all@FreeBSD.ORG Tue Jun 12 16:03:24 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E11A106564A; Tue, 12 Jun 2012 16:03:24 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 499798FC14; Tue, 12 Jun 2012 16:03:24 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 1E694256; Tue, 12 Jun 2012 18:03:23 +0200 (CEST) Date: Tue, 12 Jun 2012 18:01:29 +0200 From: Pawel Jakub Dawidek To: Mateusz Guzik Message-ID: <20120612160128.GA1429@garage.freebsd.pl> References: <201206112205.q5BM5QIv013266@svn.freebsd.org> <4FD6FD39.5090800@gmail.com> <20120612104749.GB20749@dft-labs.eu> <20120612114335.GA1372@garage.freebsd.pl> <20120612134950.GC20749@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <20120612134950.GC20749@dft-labs.eu> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, davidxu@FreeBSD.org Subject: Re: svn commit: r236935 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2012 16:03:24 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 12, 2012 at 03:49:50PM +0200, Mateusz Guzik wrote: > On Tue, Jun 12, 2012 at 01:43:35PM +0200, Pawel Jakub Dawidek wrote: > > On Tue, Jun 12, 2012 at 12:47:49PM +0200, Mateusz Guzik wrote: > > > The problem is that fdalloc grows to at most fdp->fd_nfiles * 2, which > > > still may not be enough to have place for new fd with high number. > >=20 > > I was under impression that fd_first_free() can return at most > > fdp->fd_nfiles, but indeed I missed this: > >=20 > > if (low >=3D size) > > return (low); > >=20 > > So fd_first_free() can return number biffer than size... > >=20 > > > This fixed the problem for me, although I'm not sure whether it's ok = to > > > grow the table like this: > > > http://people.freebsd.org/~mjg/patches/fdalloc.patch > >=20 > > The patch looks good to me, could you please commit it, preferably after > > David's trying it and also update fd_first_free() comment, so it is > > clear that returned value can exceed 'size -1'? > >=20 >=20 > Given that you partially reverted r236935 I created a combined patch: > http://people.freebsd.org/~mjg/patches/fdalloc%2bfd_first_free.patch >=20 > Is this ok? >=20 > Most changes are obiously yours, so I see no problem if you prefer to > commit this yourself. >=20 > Otherwise I plan to commit it with the following: > Re-apply reverted parts of r236935 by pjd with some fixes. >=20 > If fdalloc decides to grow fdtable it does it once and at most doubles > the size. This still may be not enough for sufficiently large fd. Use fd > in calculations of new size in order to fix this. >=20 > Fix description of fd_first_free to note that it returns passed fd if it > exceeds fdtable's size. >=20 > =3D=3D=3D=3D=3D=3D Look good and you can just add 'In co-operation with: pjd'. One minor thing is that fd_first_free() can return 'size' if there are no free slots available. Could you include that in the comment as well? > fd_last_used has very same problem with comment as fd_first_free. This > function is static and the only caller always passes 0 as low. Given > that, how about the following: > http://people.freebsd.org/~mjg/patches/fd_last_used-cleanup.patch Looks good too. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/XZ9gACgkQForvXbEpPzSxcACg9Se9DL/jMJYYHQ/mGvGl6vrg DrMAmgNm+j6clNG0yy6B3A5Rv/wLHcGC =/aXA -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL--