netdev
[Top] [All Lists]

Re: [NET] Fix neighbour tbl->entries race

To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [NET] Fix neighbour tbl->entries race
From: jamal <hadi@xxxxxxxxxx>
Date: 02 Nov 2004 09:13:43 -0500
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20041102112651.GA8633@xxxxxxxxxxxxxxxxxxx>
Organization: jamalopolous
References: <20041102112651.GA8633@xxxxxxxxxxxxxxxxxxx>
Reply-to: hadi@xxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
On Tue, 2004-11-02 at 06:26, Herbert Xu wrote:
> Hi Dave:
> 
> This patch turns neigh_table's entries counter into an atomic_t.  This
> is needed since tbl->entries is updated with no locks held.  This is
> no big deal in practice since it'll be off by a few entries at most
> which is way less than any of the neighbour thresholds.
> 

Is this still the same logic:

-------------
-               if (!neigh_forced_gc(tbl) &&
-                   tbl->entries > tbl->gc_thresh3)
-                       goto out;
+               neigh_forced_gc(tbl);
+               if (atomic_read(&tbl->entries) > tbl->gc_thresh3)
+                       goto out_entries;

-------

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?

cheers,
jamal



<Prev in Thread] Current Thread [Next in Thread>