[PATCH 6/8] nvme: move the NS_DEAD flag to the controller
Sagi Grimberg
sagi at grimberg.me
Mon Oct 24 01:50:22 PDT 2022
>>>> -
>>>> + if (!test_and_set_bit(NVME_CTRL_NS_DEAD, &ctrl->flags)) {
>>>> + list_for_each_entry(ns, &ctrl->namespaces, list)
>>>> + nvme_set_queue_dying(ns);
>>>> + }
>>>
>>> Looking at it now, I'm not sure I understand the need for this flag. It
>>> seems to make nvme_kill_queues reentrant safe, but the admin queue
>>> unquiesce can still end up unbalanced under reentrance?
>>>
>>> How is this not broken today (or ever since quiesce/unquiesce started
>>> accounting)? Maybe I lost some context on the exact subtlety of how
>>> nvme-pci uses this interface...
>>
>> Yes, this also looks weird and I had a TODO list entry for myself
>> to look into what is going on here. The whole interaction
>> with nvme_remove_namespaces is pretty weird to start with,
git blame points to:
0ff9d4e1a284 ("NVMe: Short-cut removal on surprise hot-unplug")
But it is unclear as to why it sits in nvme_remove_namespaces instead
of somewhere before that in nvme_remove()...
Keith?
More information about the Linux-nvme
mailing list