Skip to content

Commit 576e85c

Browse files
Xianting Tianaxboe
Xianting Tian
authored andcommitted
blk-mq: remove the calling of local_memory_node()
We don't need to check whether the node is memoryless numa node before calling allocator interface. SLUB(and SLAB,SLOB) relies on the page allocator to pick a node. Page allocator should deal with memoryless nodes just fine. It has zonelists constructed for each possible nodes. And it will automatically fall back into a node which is closest to the requested node. As long as __GFP_THISNODE is not enforced of course. The code comments of kmem_cache_alloc_node() of SLAB also showed this: * Fallback to other node is possible if __GFP_THISNODE is not set. blk-mq code doesn't set __GFP_THISNODE, so we can remove the calling of local_memory_node(). Signed-off-by: Xianting Tian <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 0669d2b commit 576e85c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

block/blk-mq-cpumap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int blk_mq_hw_queue_to_node(struct blk_mq_queue_map *qmap, unsigned int index)
8989

9090
for_each_possible_cpu(i) {
9191
if (index == qmap->mq_map[i])
92-
return local_memory_node(cpu_to_node(i));
92+
return cpu_to_node(i);
9393
}
9494

9595
return NUMA_NO_NODE;

block/blk-mq.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,7 @@ static void blk_mq_init_cpu_queues(struct request_queue *q,
27442744
for (j = 0; j < set->nr_maps; j++) {
27452745
hctx = blk_mq_map_queue_type(q, j, i);
27462746
if (nr_hw_queues > 1 && hctx->numa_node == NUMA_NO_NODE)
2747-
hctx->numa_node = local_memory_node(cpu_to_node(i));
2747+
hctx->numa_node = cpu_to_node(i);
27482748
}
27492749
}
27502750
}

0 commit comments

Comments
 (0)