All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] lightnvm: pblk: write buffer improvements
@ 2018-05-23 15:17 Marcin Dziegielewski
  2018-05-23 15:17 ` [PATCH 2/2] lightnvm: pblk: handle case when device expose mw_cunits equal to 0 Marcin Dziegielewski
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Dziegielewski @ 2018-05-23 15:17 UTC (permalink / raw)
  To: mb; +Cc: linux-block, Marcin Dziegielewski

This patchset provides two improvements related to setting size of write buffer.

Marcin Dziegielewski (2):
  lightnvm: pblk: add possibility to set write buffer size manually
  lightnvm: pblk: handle case when device expose mw_cunits equal to 0

 drivers/lightnvm/pblk-init.c | 24 +++++++++++++++++++++---
 drivers/nvme/host/lightnvm.c |  1 -
 2 files changed, 21 insertions(+), 4 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] lightnvm: pblk: handle case when device expose mw_cunits equal to 0
  2018-05-23 15:17 [PATCH 0/2] lightnvm: pblk: write buffer improvements Marcin Dziegielewski
@ 2018-05-23 15:17 ` Marcin Dziegielewski
  2018-05-24  8:18   ` Matias Bjørling
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Dziegielewski @ 2018-05-23 15:17 UTC (permalink / raw)
  To: mb; +Cc: linux-block, Marcin Dziegielewski, Igor Konopko

Some devices can expose mw_cunits equal to 0, it can cause creation of too
small write buffer and in consecuence performance drop on write workloads.

To handle that, in such case we are using default value for MLC and
beacause it covers both 1.2 and 2.0 OC specification, setting up mw_cunits
in nvme_nvm_setup_12 function isn't longer necessary.

Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
---
 drivers/lightnvm/pblk-init.c | 10 +++++++++-
 drivers/nvme/host/lightnvm.c |  1 -
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index 9a7213e..42190de 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -366,7 +366,15 @@ static int pblk_core_init(struct pblk *pblk)
 	atomic64_set(&pblk->nr_flush, 0);
 	pblk->nr_flush_rst = 0;
 
-	pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
+	if (geo->mw_cunits) {
+		pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
+	} else {
+		pblk->pgs_in_buffer = (geo->ws_opt << 3) * geo->all_luns;
+		/*
+		 * Some devices can expose mw_cunits equal to 0, so let's use
+		 * here default safe value for MLC.
+		 */
+	}
 
 	pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE);
 	max_write_ppas = pblk->min_write_pgs * geo->all_luns;
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 41279da..c747792 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -338,7 +338,6 @@ static int nvme_nvm_setup_12(struct nvme_nvm_id12 *id,
 
 	geo->ws_min = sec_per_pg;
 	geo->ws_opt = sec_per_pg;
-	geo->mw_cunits = geo->ws_opt << 3;	/* default to MLC safe values */
 
 	/* Do not impose values for maximum number of open blocks as it is
 	 * unspecified in 1.2. Users of 1.2 must be aware of this and eventually
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] lightnvm: pblk: handle case when device expose mw_cunits equal to 0
  2018-05-23 15:17 ` [PATCH 2/2] lightnvm: pblk: handle case when device expose mw_cunits equal to 0 Marcin Dziegielewski
@ 2018-05-24  8:18   ` Matias Bjørling
  0 siblings, 0 replies; 3+ messages in thread
From: Matias Bjørling @ 2018-05-24  8:18 UTC (permalink / raw)
  To: Marcin Dziegielewski; +Cc: linux-block, Igor Konopko

On 05/23/2018 05:17 PM, Marcin Dziegielewski wrote:
> Some devices can expose mw_cunits equal to 0, it can cause creation of too
> small write buffer and in consecuence performance drop on write workloads.
> 
> To handle that, in such case we are using default value for MLC and
> beacause it covers both 1.2 and 2.0 OC specification, setting up mw_cunits
> in nvme_nvm_setup_12 function isn't longer necessary.
> 
> Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
> ---
>   drivers/lightnvm/pblk-init.c | 10 +++++++++-
>   drivers/nvme/host/lightnvm.c |  1 -
>   2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
> index 9a7213e..42190de 100644
> --- a/drivers/lightnvm/pblk-init.c
> +++ b/drivers/lightnvm/pblk-init.c
> @@ -366,7 +366,15 @@ static int pblk_core_init(struct pblk *pblk)
>   	atomic64_set(&pblk->nr_flush, 0);
>   	pblk->nr_flush_rst = 0;
>   
> -	pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
> +	if (geo->mw_cunits) {
> +		pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
> +	} else {
> +		pblk->pgs_in_buffer = (geo->ws_opt << 3) * geo->all_luns;
> +		/*
> +		 * Some devices can expose mw_cunits equal to 0, so let's use
> +		 * here default safe value for MLC.
> +		 */
> +	}
>   
>   	pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE);
>   	max_write_ppas = pblk->min_write_pgs * geo->all_luns;
> diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
> index 41279da..c747792 100644
> --- a/drivers/nvme/host/lightnvm.c
> +++ b/drivers/nvme/host/lightnvm.c
> @@ -338,7 +338,6 @@ static int nvme_nvm_setup_12(struct nvme_nvm_id12 *id,
>   
>   	geo->ws_min = sec_per_pg;
>   	geo->ws_opt = sec_per_pg;
> -	geo->mw_cunits = geo->ws_opt << 3;	/* default to MLC safe values */
>   
>   	/* Do not impose values for maximum number of open blocks as it is
>   	 * unspecified in 1.2. Users of 1.2 must be aware of this and eventually
> 

Thanks Marcin. Applied for 4.18.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-24  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 15:17 [PATCH 0/2] lightnvm: pblk: write buffer improvements Marcin Dziegielewski
2018-05-23 15:17 ` [PATCH 2/2] lightnvm: pblk: handle case when device expose mw_cunits equal to 0 Marcin Dziegielewski
2018-05-24  8:18   ` Matias Bjørling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.