Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Aug 2005 12:26:23 +0200
From:      Divacky Roman <xdivac02@stud.fit.vutbr.cz>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        Dag-Erling Sm?rgrav <des@des.no>, current@freebsd.org
Subject:   Re: [PATCH]: fdalloc optimization
Message-ID:  <20050823102623.GA97332@stud.fit.vutbr.cz>
In-Reply-To: <20050822161339.GA13907@xor.obsecurity.org>
References:  <20050821084546.GA77111@stud.fit.vutbr.cz> <20050821175406.GA36164@xor.obsecurity.org> <868xyu3wln.fsf@xps.des.no> <20050822161339.GA13907@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 22, 2005 at 12:13:39PM -0400, Kris Kennaway wrote:
> On Mon, Aug 22, 2005 at 03:55:00PM +0200, Dag-Erling Sm?rgrav wrote:
> > Kris Kennaway <kris@obsecurity.org> writes:
> > > On Sun, Aug 21, 2005 at 10:45:46AM +0200, Divacky Roman wrote:
> > > > I made a patch for fdalloc which could speed it up a bit, its stored under
> > > > kern/85176 or http://hysteria.sk/~neologism/kern_descrip.patch
> > > That's all nice and everything, but *does* it speed it up a bit? :-)
> > 
> > It won't make a measurable difference, but that doesn't mean the patch
> > is wrong.
> 
> Just that it's not an optimization, as it was advertised :) As
> Poul-Henning said, if you can't measure a performance difference
> either way then sell it some other way.


here is my analyze of the problem - if its correct then the patch speeds it up

the code in fact looks:

if (fd == fdp->fd_freefile)
           fdp->fd_freefile = fd_first_free(fdp, fd, fdp->fd_nfiles);
fdp->fd_freefile = fd_first_free(fdp, fd, fdp->fd_nfiles);

fd cannot be lower then fd_freefile (because fd is technically the first
available fd)
if fd > fd_freefile it makes no sense to reset it because we would make a gap
in the bitarray
if fd == fd_freefile we must reset it because the fd is not free anymore

anyway - there is clear duplicity


the fd_freefile hinting idea is quite clear (if fd_freefile is first available
fd it makes sense to start searching from here cause everything before that is
used)


roman



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