Page MenuHomeFreeBSD

nvme: delete the I/O queues in the system shutdown path
ClosedPublic

Authored by seuros on Sun, Sep 13, 9:19 AM.
Referenced Files
Unknown Object (File)
Sat, Oct 3, 8:15 PM
Unknown Object (File)
Sat, Oct 3, 6:20 PM
Unknown Object (File)
Fri, Oct 2, 4:12 AM
Unknown Object (File)
Thu, Oct 1, 7:48 AM
Unknown Object (File)
Thu, Oct 1, 7:10 AM
Unknown Object (File)
Wed, Sep 30, 5:59 PM
Unknown Object (File)
Wed, Sep 30, 4:57 PM
Unknown Object (File)
Wed, Sep 30, 2:21 AM
Subscribers
None

Details

Summary

A normal shutdown deletes all I/O submission and completion queues
before setting CC.SHN, as the suspend path already does. The
device_shutdown path went straight to the shutdown notification with
the queues live, which some drives take slowly or record as an
unclean stop. Skipped the deletion for failed, removed, or
never-initialized controllers.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

seuros created this revision.

I love it... if it works. You may need to move it later for my suggested test to success.

sys/dev/nvme/nvme.c
55

This might need to be in a shutdown handler.

The way to test is to see if we can still take a kernel crash dump to an NVMe drive on panic... Use the sysctl to panic knob to test :).

seuros added inline comments.
sys/dev/nvme/nvme.c
55

No move is needed. nvme_shutdown() already runs inside a shutdown_final handler, wich is after doadump(), and on the panic route it does not run at all.

It only run on reboot/shutdown(8).

This revision is now accepted and ready to land.Fri, Sep 25, 5:13 PM
This revision was automatically updated to reflect the committed changes.
seuros marked an inline comment as done.