[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKEUb9DWWMggsTiRjuEs=+X1631q1bU=foH2krb-tiT_Q@mail.gmail.com>
Date: Wed, 27 Apr 2022 11:54:58 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Ido Schimmel <idosch@...sch.org>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH v2 net-next] net: generalize skb freeing deferral to
per-cpu lists
On Wed, Apr 27, 2022 at 10:59 AM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Wed, Apr 27, 2022 at 10:11 AM Eric Dumazet <edumazet@...gle.com> wrote:
> >
> > On Wed, Apr 27, 2022 at 9:53 AM Eric Dumazet <edumazet@...gle.com> wrote:
> > >
> > > On Wed, Apr 27, 2022 at 8:34 AM Ido Schimmel <idosch@...sch.org> wrote:
> > > >
> > >
> > > >
> > > > Eric, with this patch I'm seeing memory leaks such as these [1][2] after
> > > > boot. The system is using the igb driver for its management interface
> > > > [3]. The leaks disappear after reverting the patch.
> > > >
> > > > Any ideas?
> > > >
> > >
> > > No idea, skbs allocated to send an ACK can not be stored in receive
> > > queue, I guess this is a kmemleak false positive.
> > >
> > > Stress your host for hours, and check if there are real kmemleaks, as
> > > in memory being depleted.
> >
> > AT first when I saw your report I wondered if the following was needed,
> > but I do not think so. Nothing in __kfree_skb(skb) cares about skb->next.
> >
> > But you might give it a try, maybe I am wrong.
> >
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index 611bd719706412723561c27753150b27e1dc4e7a..9dc3443649b962586cc059899ac3d71e9c7a3559
> > 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -6594,6 +6594,7 @@ static void skb_defer_free_flush(struct softnet_data *sd)
> >
> > while (skb != NULL) {
> > next = skb->next;
> > + skb_mark_not_on_list(skb);
> > __kfree_skb(skb);
> > skb = next;
> > }
>
> Oh well, there is definitely a leak, sorry for that.
Ido, can you test if the following patch solves your issue ?
It definitely looks needed.
Thanks !
diff --git a/net/core/dev.c b/net/core/dev.c
index 611bd719706412723561c27753150b27e1dc4e7a..e09cd202fc579dfe2313243e20def8044aafafa2
100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6617,7 +6617,7 @@ static __latent_entropy void
net_rx_action(struct softirq_action *h)
if (list_empty(&list)) {
if (!sd_has_rps_ipi_waiting(sd) && list_empty(&repoll))
- return;
+ goto end;
break;
}
@@ -6644,6 +6644,7 @@ static __latent_entropy void
net_rx_action(struct softirq_action *h)
__raise_softirq_irqoff(NET_RX_SOFTIRQ);
net_rps_action_and_irq_enable(sd);
+end:
skb_defer_free_flush(sd);
}
Powered by blists - more mailing lists