[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.20.1905021052550.5146@dhcp-10-175-160-224.vpn.oracle.com>
Date: Thu, 2 May 2019 10:53:34 +0100 (BST)
From: Alan Maguire <alan.maguire@...cle.com>
To: David Ahern <dsahern@...nel.org>
cc: davem@...emloft.net, netdev@...r.kernel.org, ian.kumlien@...il.com,
alan.maguire@...cle.com, David Ahern <dsahern@...il.com>
Subject: Re: [PATCH net] neighbor: Reset gc_entries counter if new entry is
released before insert
On Wed, 1 May 2019, David Ahern wrote:
> From: David Ahern <dsahern@...il.com>
>
> Ian and Alan both reported seeing overflows after upgrades to 5.x kernels:
> neighbour: arp_cache: neighbor table overflow!
>
> Alan's mpls script helped get to the bottom of this bug. When a new entry
> is created the gc_entries counter is bumped in neigh_alloc to check if a
> new one is allowed to be created. ___neigh_create then searches for an
> existing entry before inserting the just allocated one. If an entry
> already exists, the new one is dropped in favor of the existing one. In
> this case the cleanup path needs to drop the gc_entries counter. There
> is no memory leak, only a counter leak.
>
> Fixes: 58956317c8d ("neighbor: Improve garbage collection")
> Reported-by: Ian Kumlien <ian.kumlien@...il.com>
> Reported-by: Alan Maguire <alan.maguire@...cle.com>
> Signed-off-by: David Ahern <dsahern@...il.com>
Tested-by: Alan Maguire <alan.maguire@...cle.com>
> ---
> net/core/neighbour.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index 30f6fd8f68e0..aff051e5521d 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -663,6 +663,8 @@ static struct neighbour *___neigh_create(struct neigh_table *tbl,
> out_tbl_unlock:
> write_unlock_bh(&tbl->lock);
> out_neigh_release:
> + if (!exempt_from_gc)
> + atomic_dec(&tbl->gc_entries);
> neigh_release(n);
> goto out;
> }
> --
> 2.11.0
>
>
Powered by blists - more mailing lists