Re: [PATCH] scsi: core: Refine how we set tag_set NUMA node

From: John Garry
Date: Tue Mar 22 2022 - 11:53:58 EST


On 22/03/2022 08:57, John Garry wrote:
/*
* Increase usage count temporarily here so that calling
* scsi_autopm_put_host() will trigger runtime idle if there is
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 0a70aa763a96..7faa83b89fa4 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1982,7 +1982,11 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost)
tag_set->nr_maps = shost->nr_maps ? : 1;
tag_set->queue_depth = shost->can_queue;
tag_set->cmd_size = cmd_size;
+ #ifdef CONFIG_NUMA
+ tag_set->numa_node = shost->dma_dev->numa_node;
+ #else
tag_set->numa_node = NUMA_NO_NODE;
+ #endif

note to self: use dev_to_node()

tag_set->flags = BLK_MQ_F_SHOULD_MERGE;
tag_set->flags |=