[PATCH] Double-level file descriptor allocation
Matthew Dillon
dillon at apollo.backplane.com
Wed Jan 21 17:01:10 PST 2004
:Skip Ford wrote:
:> Here's a DragonFly port of Tim Robbins' FreeBSD port of Niels
:> Provos' NetBSD file descriptor allocation code.
:..
:> fd Unpatched Patched
:> 1 0.765650 0.781279
:> 2001 1.148484 0.789092
:> 4001 1.546935 0.765657
:..
:> 48001 12.453618 0.812530
:
:Is there a down-side to this?
This patch is a lot cleaner then what DES did, but doesn't quite
solve the problem either.
Would either you or Skip like to adapt *just* the fd_used() and
fd_unused() pieces, without any of the bitmap stuff? i.e. don't
implement fd_lomap or fd_himap or anything like that, just create
the fd_used() and fd_unused() abstraction and the structural
field manipulation they do on the original structural fields. The
allocation, reallocation, and freeing code also has to be abstracted
into API functions.
Once that is all done and comitted we can debate how best to implement
efficient search code within the abstraction. Personally speaking, I
think that one might as well use a radix tree with simple first-free
hinting in the nodes and be done with the problem rather then all this
bi-level bitmap or DES's solution stuff which only partially solves
the problem.
-Matt
Matthew Dillon
<dillon at xxxxxxxxxxxxx>
More information about the Kernel
mailing list