@@ -2402,22 +2402,13 @@ static int blk_mq_hctx_notify_online(unsigned int cpu, struct hlist_node *node)
return 0;
}
-/*
- * 'cpu' is going away. splice any existing rq_list entries from this
- * software queue to the hw queue dispatch list, and ensure that it
- * gets run.
- */
-static int blk_mq_hctx_notify_dead(unsigned int cpu, struct hlist_node *node)
+static void blk_mq_hctx_handle_dead_cpu(struct blk_mq_hw_ctx *hctx,
+ unsigned int cpu)
{
- struct blk_mq_hw_ctx *hctx = hlist_entry_safe(node,
- struct blk_mq_hw_ctx, cpuhp_dead);
struct blk_mq_ctx *ctx;
LIST_HEAD(tmp);
enum hctx_type type;
- if (!cpumask_test_cpu(cpu, hctx->cpumask))
- return 0;
-
ctx = __blk_mq_get_ctx(hctx->queue, cpu);
type = hctx->type;
@@ -2429,13 +2420,27 @@ static int blk_mq_hctx_notify_dead(unsigned int cpu, struct hlist_node *node)
spin_unlock(&ctx->lock);
if (list_empty(&tmp))
- return 0;
+ return;
spin_lock(&hctx->lock);
list_splice_tail_init(&tmp, &hctx->dispatch);
spin_unlock(&hctx->lock);
blk_mq_run_hw_queue(hctx, true);
+}
+
+/*
+ * 'cpu' is going away. splice any existing rq_list entries from this
+ * software queue to the hw queue dispatch list, and ensure that it
+ * gets run.
+ */
+static int blk_mq_hctx_notify_dead(unsigned int cpu, struct hlist_node *node)
+{
+ struct blk_mq_hw_ctx *hctx = hlist_entry_safe(node,
+ struct blk_mq_hw_ctx, cpuhp_dead);
+
+ if (cpumask_test_cpu(cpu, hctx->cpumask))
+ blk_mq_hctx_handle_dead_cpu(hctx, cpu);
return 0;
}