All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Ido Schimmel <idosch@idosch.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH v2 net-next] net: generalize skb freeing deferral to per-cpu lists
Date: Wed, 27 Apr 2022 10:59:50 -0700	[thread overview]
Message-ID: <CANn89iK3uzj4MzAyPrjQVR+5fZQaBdopuMEAZGP6QmWeXZj19Q@mail.gmail.com> (raw)
In-Reply-To: <CANn89iLue8fy-6TTEsTwzWAog-KnAcsG19up34621W8Bp+0=NQ@mail.gmail.com>

On Wed, Apr 27, 2022 at 10:11 AM Eric Dumazet <edumazet@google.com> wrote:
>
> On Wed, Apr 27, 2022 at 9:53 AM Eric Dumazet <edumazet@google.com> wrote:
> >
> > On Wed, Apr 27, 2022 at 8:34 AM Ido Schimmel <idosch@idosch.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.

  reply	other threads:[~2022-04-27 18:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 20:12 [PATCH v2 net-next] net: generalize skb freeing deferral to per-cpu lists Eric Dumazet
2022-04-26  7:38 ` Paolo Abeni
2022-04-26 13:11   ` Eric Dumazet
2022-04-26 15:28     ` Paolo Abeni
2022-04-26 16:13       ` Eric Dumazet
2022-04-27  0:50 ` patchwork-bot+netdevbpf
2022-04-27 15:34 ` Ido Schimmel
2022-04-27 16:53   ` Eric Dumazet
2022-04-27 17:11     ` Eric Dumazet
2022-04-27 17:59       ` Eric Dumazet [this message]
2022-04-27 18:54         ` Eric Dumazet
2022-04-29 16:18 ` Qian Cai
2022-04-29 16:23   ` Eric Dumazet
2022-04-29 20:44     ` Qian Cai
2022-05-06  6:44 ` [net] 72fd55c0db: invoked_oom-killer:gfp_mask=0x kernel test robot
2022-05-06  6:44   ` kernel test robot
2022-05-06  8:15   ` Eric Dumazet
2022-05-06  8:15     ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANn89iK3uzj4MzAyPrjQVR+5fZQaBdopuMEAZGP6QmWeXZj19Q@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=idosch@idosch.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.