Skip to content

Commit

Permalink
blk-mq: remove the calling of local_memory_node()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Xianting Tian authored and axboe committed Oct 20, 2020
1 parent 0669d2b commit 576e85c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion block/blk-mq-cpumap.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int blk_mq_hw_queue_to_node(struct blk_mq_queue_map *qmap, unsigned int index)

for_each_possible_cpu(i) {
if (index == qmap->mq_map[i])
return local_memory_node(cpu_to_node(i));
return cpu_to_node(i);
}

return NUMA_NO_NODE;
Expand Down
2 changes: 1 addition & 1 deletion block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,7 @@ static void blk_mq_init_cpu_queues(struct request_queue *q,
for (j = 0; j < set->nr_maps; j++) {
hctx = blk_mq_map_queue_type(q, j, i);
if (nr_hw_queues > 1 && hctx->numa_node == NUMA_NO_NODE)
hctx->numa_node = local_memory_node(cpu_to_node(i));
hctx->numa_node = cpu_to_node(i);
}
}
}
Expand Down

0 comments on commit 576e85c

Please sign in to comment.