diff options
author | Javier González <jg@lightnvm.io> | 2017-06-30 18:56:39 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-06-30 20:08:18 +0300 |
commit | de54e703a4229e4688eb77b32b1c27861384e22a (patch) | |
tree | a615443d5f3c5ebe13616ad9331800d9b1bf466b /drivers/lightnvm/pblk-gc.c | |
parent | 8224cbd80be15908ecb6351b90291596e8bdcf79 (diff) | |
download | linux-de54e703a4229e4688eb77b32b1c27861384e22a.tar.xz |
lightnvm: pblk: use vmalloc for GC data buffer
For now, we allocate a per I/O buffer for GC data. Since the potential
size of the buffer is 256KB and GC is not in the fast path, do this
allocation with vmalloc. This puts lets pressure on the memory
allocator at no performance cost.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-gc.c')
-rw-r--r-- | drivers/lightnvm/pblk-gc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c index 9b4059b93855..6090d28f7995 100644 --- a/drivers/lightnvm/pblk-gc.c +++ b/drivers/lightnvm/pblk-gc.c @@ -20,7 +20,7 @@ static void pblk_gc_free_gc_rq(struct pblk_gc_rq *gc_rq) { - kfree(gc_rq->data); + vfree(gc_rq->data); kfree(gc_rq); } @@ -72,7 +72,7 @@ static int pblk_gc_move_valid_secs(struct pblk *pblk, struct pblk_gc_rq *gc_rq) unsigned int secs_to_gc; int ret = 0; - data = kmalloc(gc_rq->nr_secs * geo->sec_size, GFP_KERNEL); + data = vmalloc(gc_rq->nr_secs * geo->sec_size); if (!data) { ret = -ENOMEM; goto out; @@ -110,7 +110,7 @@ retry: free_rq: kfree(gc_rq); free_data: - kfree(data); + vfree(data); out: kref_put(&line->ref, pblk_line_put); return ret; |