Skip to content
  • Nigel Kirkland's avatar
    nvme: prevent warning triggered by nvme_stop_keep_alive · 97b2512a
    Nigel Kirkland authored
    
    
    Delayed keep alive work is queued on system workqueue and may be cancelled
    via nvme_stop_keep_alive from nvme_reset_wq, nvme_fc_wq or nvme_wq.
    
    Check_flush_dependency detects mismatched attributes between the work-queue
    context used to cancel the keep alive work and system-wq. Specifically
    system-wq does not have the WQ_MEM_RECLAIM flag, whereas the contexts used
    to cancel keep alive work have WQ_MEM_RECLAIM flag.
    
    Example warning:
    
      workqueue: WQ_MEM_RECLAIM nvme-reset-wq:nvme_fc_reset_ctrl_work [nvme_fc]
    	is flushing !WQ_MEM_RECLAIM events:nvme_keep_alive_work [nvme_core]
    
    To avoid the flags mismatch, delayed keep alive work is queued on nvme_wq.
    
    However this creates a secondary concern where work and a request to cancel
    that work may be in the same work queue - namely err_work in the rdma and
    tcp transports, which will want to flush/cancel the keep alive work which
    will now be on nvme_wq.
    
    After reviewing the transports, it looks like err_work can be moved to
    nvme_reset_wq. In fact that aligns them better with transition into
    RESETTING and performing related reset work in nvme_reset_wq.
    
    Change nvme-rdma and nvme-tcp to perform err_work in nvme_reset_wq.
    
    Signed-off-by: default avatarNigel Kirkland <nigel.kirkland@broadcom.com>
    Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
    Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    97b2512a