Bug #14782
closedsd.c warning message: "Unable to clean up memory" misguided
100%
Description
For users using 512e disks, the sd driver maintains a kmem cache for blocks that might be read-modify-write operations.
During close(), the sd driver attempts to possibly destroy that cache, but it checks for the list of outstanding commands, which may include commands that have nothing to do with actual I/O. (For example pending queries to drive lock states, inquiries, and so forth.)
During that close, there is an attempt to reap the kmem_cache. Which is a nice optimization. But if the driver has commands outstanding (which might not be linked to active file descriptors), it complains that it can't "clean up memory". The thing is, this circumstance is utterly benign, and depending on the state of other accesses to the disk, might be completely normal.
This message is confusing, and distressing. And ultimately, what it is complaining about is merely a failure to reap memory that will later be cleaned up if the driver detaches. (But in all likelihood, will simply be reused the next time the driver is opened.)
We've seen this message when doing, for example, zfs reopen. Or during early boot when our logic which probes drives (without actually keeping the drive open) opens and then exits.
As there is nothing really problematic here, the best thing to do is to simply remove the message. It brings no value, and raises concerns that are likely irrelevant.
Updated by Garrett D'Amore about 1 month ago
- Status changed from New to In Progress
- % Done changed from 80 to 90
Updated by Garrett D'Amore about 1 month ago
- Status changed from In Progress to Pending RTI
Updated by Garrett D'Amore about 1 month ago
Testing: We tested this change on a systems that previously would reliably get this message during early boot (due to details of our user land software). After this the message went away, and there were no other discernible changes in system behavior.
Updated by Electric Monk about 1 month ago
- Status changed from Pending RTI to Closed
- % Done changed from 90 to 100
git commit 93686a1e2cbe9bdcb1d8d3bf1870465ba0a43b1c
commit 93686a1e2cbe9bdcb1d8d3bf1870465ba0a43b1c Author: Garrett D'Amore <gdamore@racktopsystems.com> Date: 2022-07-11T02:40:44.000Z 14782 sd.c warning message: "Unable to clean up memory" misguided Reviewed by: Joyce McIntosh <jmcintosh@racktopsystems.com> Reviewed by: Sam Zaydel <szaydel@racktopsystems.com> Reviewed by: Andy Fiddaman <andy@omnios.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Richard Lowe <richlowe@richlowe.net>