提交 4317228a 编写于 作者: N Nitzan Carmi 提交者: Paul E. McKenney

nvme: Avoid flush dependency in delete controller flow

The nvme_delete_ctrl() function queues a work item on a MEM_RECLAIM
queue (nvme_delete_wq), which eventually calls cleanup_srcu_struct(),
which in turn flushes a delayed work from an !MEM_RECLAIM queue. This
is unsafe as we might trigger deadlocks under severe memory pressure.

Since we don't ever invoke call_srcu(), it is safe to use the shiny new
_quiesced() version of srcu cleanup, thus avoiding that flush dependency.
This commit makes that change.
Signed-off-by: NNitzan Carmi <nitzanc@mellanox.com>
Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: NMax Gurtovoy <maxg@mellanox.com>
Tested-by: NNicholas Piggin <npiggin@gmail.com>
上级 f7194ac3
...@@ -349,7 +349,7 @@ static void nvme_free_ns_head(struct kref *ref) ...@@ -349,7 +349,7 @@ static void nvme_free_ns_head(struct kref *ref)
nvme_mpath_remove_disk(head); nvme_mpath_remove_disk(head);
ida_simple_remove(&head->subsys->ns_ida, head->instance); ida_simple_remove(&head->subsys->ns_ida, head->instance);
list_del_init(&head->entry); list_del_init(&head->entry);
cleanup_srcu_struct(&head->srcu); cleanup_srcu_struct_quiesced(&head->srcu);
kfree(head); kfree(head);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册