Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: "open list:NVM EXPRESS DRIVER" <linux-nvme@lists.infradead.org>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	Hannes Reinecke <hare@suse.de>
Subject: blktests nvme 041,042 leak memory
Date: Sun, 26 May 2024 22:47:05 +0300	[thread overview]
Message-ID: <c4050a37-ecc9-462c-9772-65e25166f439@grimberg.me> (raw)

Just noticed that these tests generate a kmemleak complaint.

--
[ 1889.516324] kmemleak: 2 new suspected memory leaks (see 
/sys/kernel/debug/kmemleak)
[13221.498042] loop6: detected capacity change from 0 to 8
^C
root@nvme:~# cat /sys/kernel/debug/kmemleak
unreferenced object 0xffff91488fb07200 (size 256):
   comm "nvme", pid 29344, jiffies 4295069699
   hex dump (first 32 bytes):
     00 00 00 00 00 00 00 00 08 72 b0 8f 48 91 ff ff .........r..H...
     08 72 b0 8f 48 91 ff ff 00 d6 55 a2 ff ff ff ff .r..H.....U.....
   backtrace (crc 36f6c278):
     [<ffffffffa2b8b46a>] kmemleak_alloc+0x4a/0x90
     [<ffffffffa1e57897>] kmalloc_trace+0x2f7/0x3a0
     [<ffffffffa2562fd0>] device_add+0x510/0x8c0
     [<ffffffffa1ee5b9e>] cdev_device_add+0x4e/0xc0
     [<ffffffffc133b7a0>] nvme_init_ctrl+0x360/0x460 [nvme_core]
     [<ffffffffc13b0af6>] 0xffffffffc13b0af6
     [<ffffffffc120e565>] 0xffffffffc120e565
     [<ffffffffa1edeb14>] vfs_write+0x104/0x490
     [<ffffffffa1edf263>] ksys_write+0x73/0x100
     [<ffffffffa1edf319>] __x64_sys_write+0x19/0x30
     [<ffffffffa1a0553e>] x64_sys_call+0x7e/0x25c0
     [<ffffffffa2b7be01>] do_syscall_64+0x71/0x130
     [<ffffffffa2c0012b>] entry_SYSCALL_64_after_hwframe+0x76/0x7e
unreferenced object 0xffff91488ed7ea00 (size 256):
   comm "nvme", pid 37478, jiffies 4295155857
   hex dump (first 32 bytes):
     00 00 00 00 00 00 00 00 08 ea d7 8e 48 91 ff ff ............H...
     08 ea d7 8e 48 91 ff ff 00 d6 55 a2 ff ff ff ff ....H.....U.....
   backtrace (crc fc1acf5):
     [<ffffffffa2b8b46a>] kmemleak_alloc+0x4a/0x90
     [<ffffffffa1e57897>] kmalloc_trace+0x2f7/0x3a0
     [<ffffffffa2562fd0>] device_add+0x510/0x8c0
     [<ffffffffa1ee5b9e>] cdev_device_add+0x4e/0xc0
     [<ffffffffc133b7a0>] nvme_init_ctrl+0x360/0x460 [nvme_core]
     [<ffffffffc13707b7>] 0xffffffffc13707b7
     [<ffffffffc120e565>] 0xffffffffc120e565
     [<ffffffffa1edeb14>] vfs_write+0x104/0x490
     [<ffffffffa1edf263>] ksys_write+0x73/0x100
     [<ffffffffa1edf319>] __x64_sys_write+0x19/0x30
     [<ffffffffa1a0553e>] x64_sys_call+0x7e/0x25c0
     [<ffffffffa2b7be01>] do_syscall_64+0x71/0x130
     [<ffffffffa2c0012b>] entry_SYSCALL_64_after_hwframe+0x76/0x7e
--

The culprit is when failing after device_initialize/cdev_device_add...
Thought I'd share it as I'm not going to address it today.


             reply	other threads:[~2024-05-26 19:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-26 19:47 Sagi Grimberg [this message]
2024-05-27  1:11 ` blktests nvme 041,042 leak memory Yi Zhang
2024-05-28  9:44   ` Maurizio Lombardi
2024-05-29  9:08     ` Maurizio Lombardi
2024-05-29 12:51       ` Sagi Grimberg
2024-05-29 13:45         ` Maurizio Lombardi
2024-05-29 16:25         ` Keith Busch
2024-05-29 16:48           ` Keith Busch
2024-05-30  6:59           ` Sagi Grimberg
2024-05-30  7:25             ` Maurizio Lombardi
2024-05-30 16:29               ` Keith Busch
2024-05-30 17:40                 ` Maurizio Lombardi
2024-05-31 11:55                   ` Maurizio Lombardi
2024-05-31 14:37                     ` Maurizio Lombardi
2024-06-03  8:37                       ` Hannes Reinecke
2024-06-03  8:52                         ` Maurizio Lombardi
2024-06-03  9:33                           ` Hannes Reinecke
2024-06-03  9:38                             ` Maurizio Lombardi
2024-06-03  9:35                         ` Maurizio Lombardi

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=c4050a37-ecc9-462c-9772-65e25166f439@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=hare@suse.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=shinichiro.kawasaki@wdc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox