cvs commit: src/sys/netinet ip_fw2.c

Gleb Smirnoff glebius at FreeBSD.org
Mon Jan 16 04:47:18 PST 2006


On Mon, Jan 16, 2006 at 12:39:45PM +0000, Darren Reed wrote:
D> I'll mention this again...this is bad programming for the kernel.
D> 
D> While it works, it is incorrect because it doesn't use the locking
D> primitives that have been written for the radix tree.
D> 
D> This is hack work - there is nothing clever or good about it.
D> 
D> If there is a concern about locking around the radix tree impacting
D> performance then the correct thing to do is fix that, not to throw
D> away what exists today and use your own.  In that way routing would
D> also benefit from the change, not just ipfw.

There is no law to use locking in some subsystem, if the caller can
provide the safe access himself.

Radix doesn't have any locking in it. Radix is known to be not modified
by lookups. This means, that we can do lookups lockless, if we have a
guarantee that table won't be modified.

-- 
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE


More information about the cvs-src mailing list