On 03/25/15 11:54, Gleb Smirnoff wrote:
On Wed, Mar 25, 2015 at 08:55:35AM +0000, Hans Petter Selasky wrote:
H> Author: hselasky
H> Date: Wed Mar 25 08:55:34 2015
H> New Revision: 280495
H> URL: https://svnweb.freebsd.org/changeset/base/280495
H>
H> Log:
H>   Implement a simple OID number garbage collector. Given the increasing
H>   number of dynamically created and destroyed SYSCTLs during runtime it
H>   is very likely that the current new OID number limit of 0x7fffffff can
H>   be reached. Especially if dynamic OID creation and destruction results
H>   from automatic tests. Additional changes:
H>
H>   - Optimize the typical use case by decrementing the next automatic OID
H>   sequence number instead of incrementing it. This saves searching time
H>   when inserting new OIDs into a fresh parent OID node.
H>
H>   - Add simple check for duplicate non-automatic OID numbers.

Why didn't you use alloc_unr(9) for that?


Hi Gleb,

I thought about using alloc_unr(). The problem is that sysctls have no clear concept of freeing. For example in some existing code sysctl are unregistered and registered again assuming that the oid_number will be preserved. I didn't want touch those parts. Also, hence we are already traversing a list to insert an SYSCTL object in an ordered fashion, the benefit of alloc_unr() is not that big. What do you think?

--HPS



_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to