On Wed, Nov 03, 2004 at 07:37:20AM +1100, herbert wrote:
> On Tue, Nov 02, 2004 at 09:13:43AM -0500, jamal wrote:
>
> > In previous code it seems you should short-circuit if
> > neigh_forced_gc(tbl) returns non-zero. why do you have to break that
> > if statement?
>
> The previous logic is slightly incorrect in that even if neigh_forced_gc
> succeeded in removing some entries, the total number of entries may still
> be above the threshold 3.
Actually, after thinking about this a bit more, the short-circuit
is indeed correct. The logic is that if we freed up at least one
spot in the hash table then we ought to be able to take it.
In fact, we can make it a bit more effective/fair by checking the
previous entries count as well.
Here is an updated patch.
Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
p
Description: Text document
|