All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] neighbor: Reset gc_entries counter if new entry is released before insert
@ 2019-05-02  1:08 David Ahern
  2019-05-02  9:53 ` Alan Maguire
  2019-05-04  4:41 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: David Ahern @ 2019-05-02  1:08 UTC (permalink / raw)
  To: davem; +Cc: netdev, ian.kumlien, alan.maguire, David Ahern

From: David Ahern <dsahern@gmail.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@gmail.com>
Reported-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: David Ahern <dsahern@gmail.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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net] neighbor: Reset gc_entries counter if new entry is released before insert
  2019-05-02  1:08 [PATCH net] neighbor: Reset gc_entries counter if new entry is released before insert David Ahern
@ 2019-05-02  9:53 ` Alan Maguire
  2019-05-04  4:41 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Maguire @ 2019-05-02  9:53 UTC (permalink / raw)
  To: David Ahern; +Cc: davem, netdev, ian.kumlien, alan.maguire, David Ahern

On Wed, 1 May 2019, David Ahern wrote:

> From: David Ahern <dsahern@gmail.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@gmail.com>
> Reported-by: Alan Maguire <alan.maguire@oracle.com>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Tested-by: Alan Maguire <alan.maguire@oracle.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
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] neighbor: Reset gc_entries counter if new entry is released before insert
  2019-05-02  1:08 [PATCH net] neighbor: Reset gc_entries counter if new entry is released before insert David Ahern
  2019-05-02  9:53 ` Alan Maguire
@ 2019-05-04  4:41 ` David Miller
  2019-06-06 17:07   ` Jeremy Cline
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2019-05-04  4:41 UTC (permalink / raw)
  To: dsahern; +Cc: netdev, ian.kumlien, alan.maguire, dsahern

From: David Ahern <dsahern@kernel.org>
Date: Wed,  1 May 2019 18:08:34 -0700

> From: David Ahern <dsahern@gmail.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@gmail.com>
> Reported-by: Alan Maguire <alan.maguire@oracle.com>
> Signed-off-by: David Ahern <dsahern@gmail.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] neighbor: Reset gc_entries counter if new entry is released before insert
  2019-05-04  4:41 ` David Miller
@ 2019-06-06 17:07   ` Jeremy Cline
  2019-06-06 17:11     ` David Ahern
  2019-06-06 18:42     ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Jeremy Cline @ 2019-06-06 17:07 UTC (permalink / raw)
  To: David Miller; +Cc: dsahern, netdev, ian.kumlien, alan.maguire, dsahern

Hi,

On Sat, May 04, 2019 at 12:41:00AM -0400, David Miller wrote:
> From: David Ahern <dsahern@kernel.org>
> Date: Wed,  1 May 2019 18:08:34 -0700
> 
> > From: David Ahern <dsahern@gmail.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@gmail.com>
> > Reported-by: Alan Maguire <alan.maguire@oracle.com>
> > Signed-off-by: David Ahern <dsahern@gmail.com>
> 
> Applied and queued up for -stable.

Did this get lost in the shuffle? I see it in mainline, but I don't see
it in stable. Folks are encountering it with recent 5.1 kernels in
Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1708717.

Thanks,
Jeremy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] neighbor: Reset gc_entries counter if new entry is released before insert
  2019-06-06 17:07   ` Jeremy Cline
@ 2019-06-06 17:11     ` David Ahern
  2019-06-06 18:42     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Ahern @ 2019-06-06 17:11 UTC (permalink / raw)
  To: Jeremy Cline, David Miller; +Cc: dsahern, netdev, ian.kumlien, alan.maguire

On 6/6/19 11:07 AM, Jeremy Cline wrote:
> 
> Did this get lost in the shuffle? I see it in mainline, but I don't see
> it in stable. Folks are encountering it with recent 5.1 kernels in
> Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1708717.
> 
> Thanks,
> Jeremy
> 

Still in the queue:
https://patchwork.ozlabs.org/bundle/davem/stable/?series=&submitter=&state=*&q=&archive=

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] neighbor: Reset gc_entries counter if new entry is released before insert
  2019-06-06 17:07   ` Jeremy Cline
  2019-06-06 17:11     ` David Ahern
@ 2019-06-06 18:42     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2019-06-06 18:42 UTC (permalink / raw)
  To: jcline; +Cc: dsahern, netdev, ian.kumlien, alan.maguire, dsahern

From: Jeremy Cline <jcline@redhat.com>
Date: Thu, 6 Jun 2019 13:07:29 -0400

> Hi,
> 
> On Sat, May 04, 2019 at 12:41:00AM -0400, David Miller wrote:
>> From: David Ahern <dsahern@kernel.org>
>> Date: Wed,  1 May 2019 18:08:34 -0700
>> 
>> > From: David Ahern <dsahern@gmail.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@gmail.com>
>> > Reported-by: Alan Maguire <alan.maguire@oracle.com>
>> > Signed-off-by: David Ahern <dsahern@gmail.com>
>> 
>> Applied and queued up for -stable.
> 
> Did this get lost in the shuffle? I see it in mainline, but I don't see
> it in stable. Folks are encountering it with recent 5.1 kernels in
> Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1708717.

It's there in the -stable queue:

https://patchwork.ozlabs.org/bundle/davem/stable/?series=&submitter=&state=*&q=&archive=

So it will (eventually) get sent.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-06 18:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02  1:08 [PATCH net] neighbor: Reset gc_entries counter if new entry is released before insert David Ahern
2019-05-02  9:53 ` Alan Maguire
2019-05-04  4:41 ` David Miller
2019-06-06 17:07   ` Jeremy Cline
2019-06-06 17:11     ` David Ahern
2019-06-06 18:42     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.