Merge branch 'for-4.5/nvme' of git://git.kernel.dk/linux-block
[cascardo/linux.git] / block / blk-mq.c
index 8f812b4..4c0622f 100644 (file)
@@ -1793,7 +1793,7 @@ static void blk_mq_init_cpu_queues(struct request_queue *q,
                 * not, we remain on the home node of the device
                 */
                if (nr_hw_queues > 1 && hctx->numa_node == NUMA_NO_NODE)
-                       hctx->numa_node = cpu_to_node(i);
+                       hctx->numa_node = local_memory_node(cpu_to_node(i));
        }
 }
 
@@ -1853,6 +1853,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
@@ -1866,14 +1867,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)