lkml.org 
[lkml]   [2015]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] null_blk: Register as a LightNVM device
From
Date
On 11/11/2015 03:06 AM, Matias Bjørling wrote:
> Add support for registering as a LightNVM device. This allows us to
> evaluate the performance of the LightNVM library.
>
> In /drivers/Makefile, LightNVM is moved above block device drivers
> to make sure that the LightNVM media managers have been initialized
> before drivers under /drivers/block are initialized.

Generally looks ok. One question:

> +static void *null_lnvm_create_dma_pool(struct request_queue *q, char *name)
> +{
> + mempool_t *virtmem_pool;
> +
> + ppa_cache = kmem_cache_create(name, PAGE_SIZE, 0, 0, NULL);
> + if (!ppa_cache) {
> + pr_err("null_nvm: Unable to create kmem cache\n");
> + return NULL;
> + }
> +
> + virtmem_pool = mempool_create_slab_pool(64, ppa_cache);
> + if (!virtmem_pool) {
> + pr_err("null_nvm: Unable to create virtual memory pool\n");
> + return NULL;
> + }
> +
> + return virtmem_pool;
> +}

Why create a slab cache if it's pages? Why not just have the mempool
alloc/free alloc single pages?

--
Jens Axboe



\
 
 \ /
  Last update: 2015-11-11 22:41    [W:0.055 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site