Actions
Bug #12009
closedMemory leaks in blkdev when blkdev device is detached
Start date:
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
Description
Testing nvme driver for leaks. I did an nvmeadm detach nvme0/[n], then modunloaded the nvme driver.
It found the following leaks:
> ::findleaks findleaks: using cached results (use '-f' to force a full run) CACHE LEAKED BUFCTL CALLER ffffff0186027a08 22 ffffff018d3a1630 AcpiOsAllocate+0x1c ffffff0186027a08 2 ffffff018c92b440 AcpiOsAllocate+0x1c ffffff0186027a08 1 ffffff018c941890 AcpiOsAllocate+0x1c ffffff0186027a08 88 ffffff018d3a2dd0 AcpiOsAllocate+0x1c ffffff0186027a08 3 ffffff0193bfece8 AcpiOsAllocate+0x1c ffffff0186027a08 1 ffffff018c4c6b60 AcpiOsAllocate+0x1c ffffff0186025a08 2 ffffff018c9d4490 AcpiOsAllocate+0x1c ffffff0186025a08 1 ffffff018f2b1570 AcpiOsAllocate+0x1c ffffff0186027a08 2 ffffff018c92b368 AcpiOsAllocate+0x1c ffffff0186027a08 1 ffffff018c92b518 AcpiOsAllocate+0x1c ffffff0186027a08 187 ffffff019b3ae480 AcpiOsAllocate+0x1c ffffff0186027a08 2 ffffff018c4d1978 AcpiOsAllocate+0x1c ffffff0186027a08 17 ffffff0193bfedc0 AcpiOsAllocate+0x1c ffffff0186027a08 3 ffffff018c92b290 AcpiOsAllocate+0x1c ffffff0186027a08 190 ffffff01adb50628 AcpiOsAllocate+0x1c ffffff0186027a08 2 ffffff018c92b6c8 AcpiOsAllocate+0x1c ffffff0186025a08 510 ffffff018c67fd20 AcpiOsAllocate+0x1c ffffff0186027a08 1 ffffff018c9ab2d0 AcpiOsAllocate+0x1c ffffff0186025a08 4 ffffff018c67eec8 AcpiOsAllocate+0x1c ffffff0186025a08 2 ffffff01ab2d9650 bd_errstats_setstr+0x6e ffffff0186027288 2 ffffff01925646c0 bd_errstats_setstr+0x6e ffffff0186025788 2 ffffff01acbeb018 bd_errstats_setstr+0x6e ffffff0186027288 1 ffffff01905d7ec8 bd_errstats_setstr+0x6e ffffff0186025788 1 ffffff01ab6374a8 bd_errstats_setstr+0x6e ffffff0186025a08 1 ffffff01ab2d99b0 bd_errstats_setstr+0x6e ffffff018602a788 1 ffffff01a72c7c00 ufm_cache_fill+0x1c0 ------------------------------------------------------------------------ Total 1049 buffers, 54944 bytes >
Updated by Paul Winder almost 4 years ago
Tested change under Fusion.
Created two drives which had the following kstat:
# kstat blkdeverr: module: blkdeverr instance: 0 name: blkdev0,err class: device_error crtime 74.377179652 Device Not Ready 0 Hard Errors 0 Illegal Request 0 Media Error 0 Model VMware Virtual NVMe Disk No Device 0 Predictive Failure Analysis 0 Recoverable 0 Revision 1.0 Serial No VMWare NVME_0000 Size 5368709120 snaptime 136.460668912 Soft Errors 0 Transport Errors 0 module: blkdeverr instance: 1 name: blkdev1,err class: device_error crtime 74.377399845 Device Not Ready 0 Hard Errors 0 Illegal Request 0 Media Error 0 Model VMware Virtual NVMe Disk No Device 0 Predictive Failure Analysis 0 Recoverable 0 Revision 1.0 Serial No VMWare NVME_0000 Size 5368709120 snaptime 136.460680213 Soft Errors 0 Transport Errors 0
Removed them, and kstat (as expected) now:
# nvmeadm detach nvme0/1 # nvmeadm detach nvme0/2 # kstat blkdeverr: module: blkdeverr instance: 0 name: blkdev0,err class: device_error crtime 74.377179652 Device Not Ready 0 Hard Errors 0 Illegal Request 0 Media Error 0 Model (null) No Device 0 Predictive Failure Analysis 0 Recoverable 0 Revision (null) Serial No (null) Size 5368709120 snaptime 175.742142110 Soft Errors 0 Transport Errors 0 module: blkdeverr instance: 1 name: blkdev1,err class: device_error crtime 74.377399845 Device Not Ready 0 Hard Errors 0 Illegal Request 0 Media Error 0 Model (null) No Device 0 Predictive Failure Analysis 0 Recoverable 0 Revision (null) Serial No (null) Size 5368709120 snaptime 175.742150852 Soft Errors 0 Transport Errors 0
And finally, ::findleaks after reboot -d - the blkdev leak has gone.:
> ::findleaks CACHE LEAKED BUFCTL CALLER ffffff0186027a08 25 ffffff018d3a18b8 AcpiOsAllocate+0x1c ffffff0186027a08 2 ffffff018c92b440 AcpiOsAllocate+0x1c ffffff0186027a08 1 ffffff018c92b518 AcpiOsAllocate+0x1c ffffff0186027a08 107 ffffff01b07733c0 AcpiOsAllocate+0x1c ffffff0186027a08 2 ffffff018c4d1978 AcpiOsAllocate+0x1c ffffff0186027a08 27 ffffff0194468378 AcpiOsAllocate+0x1c ffffff0186027a08 3 ffffff018c92b290 AcpiOsAllocate+0x1c ffffff0186027a08 108 ffffff01aafc45e8 AcpiOsAllocate+0x1c ffffff0186027a08 2 ffffff018c92b6c8 AcpiOsAllocate+0x1c ffffff0186025a08 368 ffffff018c67fd20 AcpiOsAllocate+0x1c ffffff0186027a08 1 ffffff018c9ab2d0 AcpiOsAllocate+0x1c ffffff0186025a08 4 ffffff018c67eec8 AcpiOsAllocate+0x1c ffffff0186027a08 1 ffffff018c941890 AcpiOsAllocate+0x1c ffffff0186027a08 97 ffffff018d3a1120 AcpiOsAllocate+0x1c ffffff0186027a08 5 ffffff01941f62c0 AcpiOsAllocate+0x1c ffffff0186027a08 1 ffffff018c4c6b60 AcpiOsAllocate+0x1c ffffff0186025a08 2 ffffff018c9d4490 AcpiOsAllocate+0x1c ffffff0186025a08 1 ffffff018f2f6bd8 AcpiOsAllocate+0x1c ffffff0186027a08 2 ffffff018c92b368 AcpiOsAllocate+0x1c ffffff018602a788 1 ffffff01a4fa5110 ufm_cache_fill+0x1c0 ------------------------------------------------------------------------ Total 760 buffers, 40232 bytes >
Updated by Paul Winder almost 4 years ago
- Status changed from New to In Progress
Updated by Paul Winder almost 4 years ago
Review is: https://illumos.org/rb/r/2460/
Updated by Electric Monk almost 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit 247e9a8ed695b16d62e2a0cb581e5c07d949d5ae
commit 247e9a8ed695b16d62e2a0cb581e5c07d949d5ae Author: Paul Winder <paul@winders.demon.co.uk> Date: 2019-11-25T16:10:02.000Z 12009 Memory leaks in blkdev when blkdev device is detached Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Randy Fishel <randyf@sibernet.com> Reviewed by: Matthias Scheler <matthias.scheler@wdc.com> Approved by: Dan McDonald <danmcd@joyent.com>
Actions