blk-mq: Reuse hardware context cpumask for tags
[linux-drm-fsl-dcu.git] / block / blk-mq.c
index 93a4e19569151b6ac8854a8cea44f3195f5b6369..35da31841edaf1f4a384c2eb1a8d22194341cf4e 100644 (file)
@@ -1850,6 +1850,7 @@ static void blk_mq_map_swqueue(struct request_queue *q,
                hctx->tags = set->tags[i];
                WARN_ON(!hctx->tags);
 
+               cpumask_copy(hctx->tags->cpumask, hctx->cpumask);
                /*
                 * Set the map size to the number of mapped software queues.
                 * This is more accurate and more efficient than looping
@@ -1863,14 +1864,6 @@ static void blk_mq_map_swqueue(struct request_queue *q,
                hctx->next_cpu = cpumask_first(hctx->cpumask);
                hctx->next_cpu_batch = BLK_MQ_CPU_WORK_BATCH;
        }
-
-       queue_for_each_ctx(q, ctx, i) {
-               if (!cpumask_test_cpu(i, online_mask))
-                       continue;
-
-               hctx = q->mq_ops->map_queue(q, i);
-               cpumask_set_cpu(i, hctx->tags->cpumask);
-       }
 }
 
 static void queue_set_hctx_shared(struct request_queue *q, bool shared)