diff mbox series

[SRU,Bionic,1/1] s390/dasd: reduce the default queue depth and nr of hardware queues

Message ID 1573731982-7370-2-git-send-email-frank.heimes@canonical.com
State New
Headers show
Series s390/dasd: reduce the default queue depth and nr of hardware queues (LP: 1852257) | expand

Commit Message

Frank Heimes Nov. 14, 2019, 11:46 a.m. UTC
From: Stefan Haberland <sth@linux.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1852257

Reduce the default values for the number of hardware queues and queue depth
to significantly reduce the memory footprint of a DASD device.
The memory consumption per DASD device reduces from approximately 40MB to
approximately 1.5MB.

This is necessary to build systems with a large number of DASD devices and
a reasonable amount of memory.
Performance measurements showed that good performance results are possible
with the new default values even on systems with lots of CPUs and lots of
alias devices.

Fixes: e443343e509a ("s390/dasd: blk-mq conversion")
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(backported from commit 3284da34a87ab7a527a593f89bbdaf6debe9e713)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
---
 drivers/s390/block/dasd.c     | 13 +++++++++++--
 drivers/s390/block/dasd_int.h |  8 --------
 2 files changed, 11 insertions(+), 10 deletions(-)

Comments

Stefan Bader Nov. 28, 2019, 11:38 a.m. UTC | #1
On 14.11.19 12:46, frank.heimes@canonical.com wrote:
> From: Stefan Haberland <sth@linux.ibm.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1852257
> 
> Reduce the default values for the number of hardware queues and queue depth
> to significantly reduce the memory footprint of a DASD device.
> The memory consumption per DASD device reduces from approximately 40MB to
> approximately 1.5MB.
> 
> This is necessary to build systems with a large number of DASD devices and
> a reasonable amount of memory.
> Performance measurements showed that good performance results are possible
> with the new default values even on systems with lots of CPUs and lots of
> alias devices.
> 
> Fixes: e443343e509a ("s390/dasd: blk-mq conversion")
> Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
> Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> (backported from commit 3284da34a87ab7a527a593f89bbdaf6debe9e713)
> Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/s390/block/dasd.c     | 13 +++++++++++--
>  drivers/s390/block/dasd_int.h |  8 --------
>  2 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
> index 0c4b730..d61f17f 100644
> --- a/drivers/s390/block/dasd.c
> +++ b/drivers/s390/block/dasd.c
> @@ -41,6 +41,15 @@
>  
>  #define DASD_DIAG_MOD		"dasd_diag_mod"
>  
> +static unsigned int queue_depth = 32;
> +static unsigned int nr_hw_queues = 4;
> +
> +module_param(queue_depth, uint, 0444);
> +MODULE_PARM_DESC(queue_depth, "Default queue depth for new DASD devices");
> +
> +module_param(nr_hw_queues, uint, 0444);
> +MODULE_PARM_DESC(nr_hw_queues, "Default number of hardware queues for new DASD devices");
> +
>  /*
>   * SECTION: exported variables of dasd.c
>   */
> @@ -3184,8 +3193,8 @@ static int dasd_alloc_queue(struct dasd_block *block)
>  
>  	block->tag_set.ops = &dasd_mq_ops;
>  	block->tag_set.cmd_size = sizeof(struct dasd_ccw_req *);
> -	block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES;
> -	block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV;
> +	block->tag_set.nr_hw_queues = nr_hw_queues;
> +	block->tag_set.queue_depth = queue_depth;
>  	block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
>  	block->tag_set.numa_node = NUMA_NO_NODE;
>  
> diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
> index 96709b1..d518a1e 100644
> --- a/drivers/s390/block/dasd_int.h
> +++ b/drivers/s390/block/dasd_int.h
> @@ -235,14 +235,6 @@ struct dasd_ccw_req {
>  #define DASD_CQR_SUPPRESS_IL	6	/* Suppress 'Incorrect Length' error */
>  #define DASD_CQR_SUPPRESS_CR	7	/* Suppress 'Command Reject' error */
>  
> -/*
> - * There is no reliable way to determine the number of available CPUs on
> - * LPAR but there is no big performance difference between 1 and the
> - * maximum CPU number.
> - * 64 is a good trade off performance wise.
> - */
> -#define DASD_NR_HW_QUEUES 64
> -#define DASD_MAX_LCU_DEV 256
>  #define DASD_REQ_PER_DEV 4
>  
>  /* Signature for error recovery functions. */
>
Kleber Sacilotto de Souza Nov. 29, 2019, 5:23 p.m. UTC | #2
On 14.11.19 12:46, frank.heimes@canonical.com wrote:
> From: Stefan Haberland <sth@linux.ibm.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1852257
> 
> Reduce the default values for the number of hardware queues and queue depth
> to significantly reduce the memory footprint of a DASD device.
> The memory consumption per DASD device reduces from approximately 40MB to
> approximately 1.5MB.
> 
> This is necessary to build systems with a large number of DASD devices and
> a reasonable amount of memory.
> Performance measurements showed that good performance results are possible
> with the new default values even on systems with lots of CPUs and lots of
> alias devices.
> 
> Fixes: e443343e509a ("s390/dasd: blk-mq conversion")
> Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
> Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> (backported from commit 3284da34a87ab7a527a593f89bbdaf6debe9e713)
> Signed-off-by: Frank Heimes <frank.heimes@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  drivers/s390/block/dasd.c     | 13 +++++++++++--
>  drivers/s390/block/dasd_int.h |  8 --------
>  2 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
> index 0c4b730..d61f17f 100644
> --- a/drivers/s390/block/dasd.c
> +++ b/drivers/s390/block/dasd.c
> @@ -41,6 +41,15 @@
>  
>  #define DASD_DIAG_MOD		"dasd_diag_mod"
>  
> +static unsigned int queue_depth = 32;
> +static unsigned int nr_hw_queues = 4;
> +
> +module_param(queue_depth, uint, 0444);
> +MODULE_PARM_DESC(queue_depth, "Default queue depth for new DASD devices");
> +
> +module_param(nr_hw_queues, uint, 0444);
> +MODULE_PARM_DESC(nr_hw_queues, "Default number of hardware queues for new DASD devices");
> +
>  /*
>   * SECTION: exported variables of dasd.c
>   */
> @@ -3184,8 +3193,8 @@ static int dasd_alloc_queue(struct dasd_block *block)
>  
>  	block->tag_set.ops = &dasd_mq_ops;
>  	block->tag_set.cmd_size = sizeof(struct dasd_ccw_req *);
> -	block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES;
> -	block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV;
> +	block->tag_set.nr_hw_queues = nr_hw_queues;
> +	block->tag_set.queue_depth = queue_depth;
>  	block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
>  	block->tag_set.numa_node = NUMA_NO_NODE;
>  
> diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
> index 96709b1..d518a1e 100644
> --- a/drivers/s390/block/dasd_int.h
> +++ b/drivers/s390/block/dasd_int.h
> @@ -235,14 +235,6 @@ struct dasd_ccw_req {
>  #define DASD_CQR_SUPPRESS_IL	6	/* Suppress 'Incorrect Length' error */
>  #define DASD_CQR_SUPPRESS_CR	7	/* Suppress 'Command Reject' error */
>  
> -/*
> - * There is no reliable way to determine the number of available CPUs on
> - * LPAR but there is no big performance difference between 1 and the
> - * maximum CPU number.
> - * 64 is a good trade off performance wise.
> - */
> -#define DASD_NR_HW_QUEUES 64
> -#define DASD_MAX_LCU_DEV 256
>  #define DASD_REQ_PER_DEV 4
>  
>  /* Signature for error recovery functions. */
>
diff mbox series

Patch

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 0c4b730..d61f17f 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -41,6 +41,15 @@ 
 
 #define DASD_DIAG_MOD		"dasd_diag_mod"
 
+static unsigned int queue_depth = 32;
+static unsigned int nr_hw_queues = 4;
+
+module_param(queue_depth, uint, 0444);
+MODULE_PARM_DESC(queue_depth, "Default queue depth for new DASD devices");
+
+module_param(nr_hw_queues, uint, 0444);
+MODULE_PARM_DESC(nr_hw_queues, "Default number of hardware queues for new DASD devices");
+
 /*
  * SECTION: exported variables of dasd.c
  */
@@ -3184,8 +3193,8 @@  static int dasd_alloc_queue(struct dasd_block *block)
 
 	block->tag_set.ops = &dasd_mq_ops;
 	block->tag_set.cmd_size = sizeof(struct dasd_ccw_req *);
-	block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES;
-	block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV;
+	block->tag_set.nr_hw_queues = nr_hw_queues;
+	block->tag_set.queue_depth = queue_depth;
 	block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
 	block->tag_set.numa_node = NUMA_NO_NODE;
 
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 96709b1..d518a1e 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -235,14 +235,6 @@  struct dasd_ccw_req {
 #define DASD_CQR_SUPPRESS_IL	6	/* Suppress 'Incorrect Length' error */
 #define DASD_CQR_SUPPRESS_CR	7	/* Suppress 'Command Reject' error */
 
-/*
- * There is no reliable way to determine the number of available CPUs on
- * LPAR but there is no big performance difference between 1 and the
- * maximum CPU number.
- * 64 is a good trade off performance wise.
- */
-#define DASD_NR_HW_QUEUES 64
-#define DASD_MAX_LCU_DEV 256
 #define DASD_REQ_PER_DEV 4
 
 /* Signature for error recovery functions. */