From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Ming Lei To: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , Mike Snitzer Cc: linux-scsi@vger.kernel.org, Hannes Reinecke , Arun Easi , Omar Sandoval , "Martin K . Petersen" , James Bottomley , Christoph Hellwig , Don Brace , Kashyap Desai , Peter Rivera , Laurence Oberman , Ming Lei Subject: [PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset Date: Tue, 27 Feb 2018 18:07:50 +0800 Message-Id: <20180227100750.32299-9-ming.lei@redhat.com> In-Reply-To: <20180227100750.32299-1-ming.lei@redhat.com> References: <20180227100750.32299-1-ming.lei@redhat.com> List-ID: It is observed on null_blk that IOPS can be improved much by simply making hw queue per NUMA node, so this patch applies the introduced .host_tagset for improving performance. In reality, .can_queue is quite big, and NUMA node number is often small, so each hw queue's depth should be high enough to saturate device. Cc: Arun Easi Cc: Omar Sandoval , Cc: "Martin K. Petersen" , Cc: James Bottomley , Cc: Christoph Hellwig , Cc: Don Brace Cc: Kashyap Desai Cc: Peter Rivera Cc: Laurence Oberman Cc: Hannes Reinecke Cc: Mike Snitzer Signed-off-by: Ming Lei --- drivers/scsi/megaraid/megaraid_sas_base.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 065956cb2aeb..0b46f97cbfdb 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -3177,6 +3177,7 @@ static struct scsi_host_template megasas_template = { .use_clustering = ENABLE_CLUSTERING, .change_queue_depth = scsi_change_queue_depth, .no_write_same = 1, + .host_tagset = 1, }; /** @@ -5947,6 +5948,8 @@ static int megasas_start_aen(struct megasas_instance *instance) static int megasas_io_attach(struct megasas_instance *instance) { struct Scsi_Host *host = instance->host; + /* 256 tags should be high enough to saturate device */ + int max_queues = DIV_ROUND_UP(host->can_queue, 256); /* * Export parameters required by SCSI mid-layer @@ -5987,6 +5990,9 @@ static int megasas_io_attach(struct megasas_instance *instance) host->max_lun = MEGASAS_MAX_LUN; host->max_cmd_len = 16; + /* per NUMA node hw queue */ + host->nr_hw_queues = min_t(int, nr_node_ids, max_queues); + /* * Notify the mid-layer about the new controller */ -- 2.9.5