[PATCH 1/4] driver core: Support two-pass driver shutdown

Jeremy Allison jra at samba.org
Tue Jan 2 10:07:30 PST 2024


On Wed, Dec 27, 2023 at 02:33:37PM -0600, Bjorn Helgaas wrote:
>On Thu, Dec 21, 2023 at 09:22:54AM -0800, Jeremy Allison wrote:
>> From: Tanjore Suresh <tansuresh at google.com>
>>
>> This changes the bus driver interface with an additional entry point
>> to enable devices to implement two-pass shutdown. The existing
>> synchronous interface to shutdown is called, and if a shutdown_wait
>> method is defined the device is moved to an alternate list.
>>
>> Once the shutdown method is called for all devices, the
>> shutdown_wait method is then called synchronously for
>> all devices on the alternate list.
>
>Christoph and Sagi noted that the objective is similar to "fire now
>and wait for completion later."
>
>Would it be practical to actually *do* that, e.g., add a global
>shutdown workqueue, have the .shutdown() method of nvme and similar
>drivers add items to it, and have the driver core wait until
>everything on that workqueue has completed?
>
>But I'm not a workqueue expert and I do see the scary warning at
>https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/workqueue.h?id=v6.6#n619,
>about not flushing system-wide workqueues, so maybe this wouldn't be
>workable.

This is a bigger change than I'm comfortable with
(or indeed understand :-) right now. Can we fix
the immediate problem first please and then look
for improvements later ?



More information about the Linux-nvme mailing list