diff mbox

[4/9] lightnvm: pblk: start gc if needed during init

Message ID 1507025113-13351-5-git-send-email-hans.ml.holmberg@owltronix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hans Holmberg Oct. 3, 2017, 10:05 a.m. UTC
From: Hans Holmberg <hans.holmberg@cnexlabs.com>

Start GC, if needed, directly after init, as we might
need to garbage collect to make room for user writes.

Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
---
 drivers/lightnvm/pblk-init.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

=?UTF-8?q?Javier=20Gonz=C3=A1lez?= Oct. 3, 2017, 10:36 a.m. UTC | #1
> On 3 Oct 2017, at 12.05, Hans Holmberg <hans.ml.holmberg@owltronix.com> wrote:
> 
> From: Hans Holmberg <hans.holmberg@cnexlabs.com>
> 
> Start GC, if needed, directly after init, as we might
> need to garbage collect to make room for user writes.
> 
> Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
> ---
> drivers/lightnvm/pblk-init.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
> index 1cc3de4..fb41182 100644
> --- a/drivers/lightnvm/pblk-init.c
> +++ b/drivers/lightnvm/pblk-init.c
> @@ -1022,6 +1022,10 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk,
> 			pblk->rwb.nr_entries);
> 
> 	wake_up_process(pblk->writer_ts);
> +
> +	/* Check if we need to start GC */
> +	pblk_gc_should_kick(pblk);
> +
> 	return pblk;
> 
> fail_stop_writer:
> --
> 2.7.4

LGTM.

Reviewed-by: Javier González <javier@cnexlabs.com>
diff mbox

Patch

diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index 1cc3de4..fb41182 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -1022,6 +1022,10 @@  static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk,
 			pblk->rwb.nr_entries);
 
 	wake_up_process(pblk->writer_ts);
+
+	/* Check if we need to start GC */
+	pblk_gc_should_kick(pblk);
+
 	return pblk;
 
 fail_stop_writer: