All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <mb@lightnvm.io>
To: axboe@fb.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	bart.vanassche@wdc.com, hans.holmberg@cnexlabs.com,
	javier@cnexlabs.com, hlitz@ucsc.edu, igor.j.konopko@intel.com,
	marcin.dziegielewski@intel.com,
	"Matias Bjørling" <mb@lightnvm.io>
Subject: [GIT PULL 01/10] lightnvm: pblk: handle case when mw_cunits equals to 0
Date: Fri, 13 Jul 2018 10:48:36 +0200	[thread overview]
Message-ID: <20180713084845.19511-2-mb@lightnvm.io> (raw)
In-Reply-To: <20180713084845.19511-1-mb@lightnvm.io>

From: Marcin Dziegielewski <marcin.dziegielewski@intel.com>

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

Additionally, write buffer size must cover write data requirements,
such as WS_MIN and MW_CUNITS - it must be greater than or equal to
the larger one multiplied by the number of PUs. However, for
performance reasons, use the WS_OPT value to calculation instead of
WS_MIN.

Because the place where buffer size is calculated was changed, this
patch also removes pgs_in_buffer filed in pblk structure.

Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
---
 drivers/lightnvm/pblk-init.c | 9 +++++----
 drivers/lightnvm/pblk.h      | 3 ---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index b57f764d6a16..ef8d8dea7b6b 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -179,11 +179,14 @@ static int pblk_rwb_init(struct pblk *pblk)
 	struct pblk_rb_entry *entries;
 	unsigned long nr_entries, buffer_size;
 	unsigned int power_size, power_seg_sz;
+	int pgs_in_buffer;
 
-	if (write_buffer_size && (write_buffer_size > pblk->pgs_in_buffer))
+	pgs_in_buffer = max(geo->mw_cunits, geo->ws_opt) * geo->all_luns;
+
+	if (write_buffer_size && (write_buffer_size > pgs_in_buffer))
 		buffer_size = write_buffer_size;
 	else
-		buffer_size = pblk->pgs_in_buffer;
+		buffer_size = pgs_in_buffer;
 
 	nr_entries = pblk_rb_calculate_size(buffer_size);
 
@@ -366,8 +369,6 @@ 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;
-
 	pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE);
 	max_write_ppas = pblk->min_write_pgs * geo->all_luns;
 	pblk->max_write_pgs = min_t(int, max_write_ppas, NVM_MAX_VLBA);
diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
index 34cc1d64a9d4..9d1a0e86e082 100644
--- a/drivers/lightnvm/pblk.h
+++ b/drivers/lightnvm/pblk.h
@@ -608,9 +608,6 @@ struct pblk {
 
 	int min_write_pgs; /* Minimum amount of pages required by controller */
 	int max_write_pgs; /* Maximum amount of pages supported by controller */
-	int pgs_in_buffer; /* Number of pages that need to be held in buffer to
-			    * guarantee successful reads.
-			    */
 
 	sector_t capacity; /* Device capacity when bad blocks are subtracted */
 
-- 
2.11.0

  reply	other threads:[~2018-07-13  9:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13  8:48 [GIT PULL 00/10] lightnvm updates for 4.19 Matias Bjørling
2018-07-13  8:48 ` Matias Bjørling [this message]
2018-07-13  8:48 ` [GIT PULL 02/10] lightnvm: move NVM_DEBUG to pblk Matias Bjørling
2018-07-13  8:48 ` [GIT PULL 03/10] lightnvm: pblk: enable line minor version detection Matias Bjørling
2018-07-13  8:48 ` [GIT PULL 04/10] lightnvm: Remove redundant rq->__data_len initialization Matias Bjørling
2018-07-13  8:48 ` [GIT PULL 05/10] lightnvm: pblk: fix read_bitmap for 32bit archs Matias Bjørling
2018-07-13  8:48 ` [GIT PULL 06/10] lightnvm: limit get chunk meta request size Matias Bjørling
2018-07-13  8:48 ` [GIT PULL 07/10] lightnvm: pblk: expose generic disk name on pr_* msgs Matias Bjørling
2018-07-13  8:48 ` [GIT PULL 08/10] lightnvm: pblk: mark expected switch fall-through Matias Bjørling
2018-07-13  8:48 ` [GIT PULL 09/10] lightnvm: pblk: add asynchronous partial read Matias Bjørling
2018-07-13  8:48 ` [GIT PULL 10/10] lightnvm: pblk: assume that chunks are closed on 1.2 devices Matias Bjørling
2018-07-13 14:15 ` [GIT PULL 00/10] lightnvm updates for 4.19 Jens Axboe
2018-07-13 14:15   ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180713084845.19511-2-mb@lightnvm.io \
    --to=mb@lightnvm.io \
    --cc=axboe@fb.com \
    --cc=bart.vanassche@wdc.com \
    --cc=hans.holmberg@cnexlabs.com \
    --cc=hlitz@ucsc.edu \
    --cc=igor.j.konopko@intel.com \
    --cc=javier@cnexlabs.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.dziegielewski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.