From: David Ahern <dsahern@gmail.com>
To: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>,
dsahern@kernel.org, netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: Re: [PATCH net] veth: Free queues on link delete
Date: Tue, 14 Aug 2018 18:47:25 -0600 [thread overview]
Message-ID: <801c8cd8-bcee-2961-aed9-975cfa966890@gmail.com> (raw)
In-Reply-To: <b319bf6a-35fe-2454-f11a-267953363ee8@lab.ntt.co.jp>
On 8/14/18 6:37 PM, Toshiaki Makita wrote:
> On 2018/08/15 7:36, dsahern@kernel.org wrote:
>> From: David Ahern <dsahern@gmail.com>
>>
>> kmemleak reported new suspected memory leaks.
>> $ cat /sys/kernel/debug/kmemleak
>> unreferenced object 0xffff880130b6ec00 (size 1024):
>> comm "ip", pid 916, jiffies 4296194668 (age 7251.672s)
>> hex dump (first 32 bytes):
>> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
>> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
>> backtrace:
>> [<000000001ed37cc9>] kmemleak_alloc+0x70/0x94
>> [<00000000646dfdeb>] slab_post_alloc_hook+0x42/0x52
>> [<0000000004aba61b>] __kmalloc+0x101/0x142
>> [<0000000054d50e21>] kmalloc_array.constprop.20+0x1e/0x26 [veth]
>> [<000000008238855a>] veth_newlink+0x147/0x3ac [veth]
>> ...
>>
>> The allocation in question is veth_alloc_queues.
>>
>> Free the queues on a delete.
>
> Oops, thanks for catching this.
>
>> Fixes: 638264dc90227 ("veth: Support per queue XDP ring")
>> Signed-off-by: David Ahern <dsahern@gmail.com>
>> ---
>> drivers/net/veth.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
>> index e3202af72df5..bef7d212f04e 100644
>> --- a/drivers/net/veth.c
>> +++ b/drivers/net/veth.c
>> @@ -1205,6 +1205,7 @@ static void veth_dellink(struct net_device *dev, struct list_head *head)
>> struct veth_priv *priv;
>> struct net_device *peer;
>>
>> + veth_free_queues(dev);
>> priv = netdev_priv(dev);
>> peer = rtnl_dereference(priv->peer);
>
> We need to free up peer queues as well.
missed that. Odd that kmemleak was not complaining.
> Also isn't this for net-next though it is now closed?
>
yes. was not sure if net-next is now net.
will send a v2.
next prev parent reply other threads:[~2018-08-15 3:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 22:36 [PATCH net] veth: Free queues on link delete dsahern
2018-08-15 0:37 ` Toshiaki Makita
2018-08-15 0:47 ` David Ahern [this message]
2018-08-16 0:44 ` kbuild test robot
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=801c8cd8-bcee-2961-aed9-975cfa966890@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=makita.toshiaki@lab.ntt.co.jp \
--cc=netdev@vger.kernel.org \
/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.