Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jan 2006 15:47:14 +0300
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Darren Reed <darrenr@hub.freebsd.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/netinet ip_fw2.c
Message-ID:  <20060116124714.GZ83922@FreeBSD.org>
In-Reply-To: <20060116123945.GA49077@hub.freebsd.org>
References:  <200601150055.k0F0t52R028617@repoman.freebsd.org> <20060116123945.GA49077@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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