Port of Niels Provos's file descriptor allocation code

Dag-ErlingSmørgrav des at des.no
Fri Nov 28 21:11:45 PST 2003

I've run some benchmarks of my own with and without the patch, and
it's a definite improvement...  I expected it to go linear for large
number of open file descriptors, and it does, but the slope is much
less steep than I expected, which explains why it looked like O(1).

I have two objections to the patch, however: the first is the use of
NDENTRYSHIFT to obfuscate multiplications and divisions by NDENTRIES
(which is a constant, so the compiler will optimize it anyway).  The
second is the use of uint32_t instead of unsigned long which should be
more efficient on 64-bit machines (NDENTRIES would have to be made
dependent on sizeof(unsigned long))

and it scares me a bit that the Banga & Mogul paper has been floating
around for five years and nobody took any notice...

Dag-Erling Smørgrav - des at des.no

More information about the freebsd-current mailing list