diff options
author | Hans Holmberg <hans.holmberg@cnexlabs.com> | 2017-10-13 14:46:37 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-10-13 08:34:57 -0600 |
commit | 03661b5f756c92b9924869334a2afa19753c4fe7 (patch) | |
tree | abe763a5913b21f5fb86440cd54b2e8be2e69e4e /drivers/lightnvm/pblk-init.c | |
parent | 37ce33d5756f4ba8bdd45371a1918ceeeba5b158 (diff) | |
download | linux-03661b5f756c92b9924869334a2afa19753c4fe7.tar.gz |
lightnvm: pblk: start gc if needed during init
Start GC if needed, directly after init, as we might need to garbage collect in order to make room for user writes. Create a helper function that allows to kick GC without exposing the internals of the GC/rate-limiter interaction. Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-init.c')
-rw-r--r-- | drivers/lightnvm/pblk-init.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index f08fa2083fbc..ad9f014a086b 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -1025,6 +1025,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: |