Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1267479

Re: [PATCH] null_blk: Register as a LightNVM device

From Jens Axboe <axboe@kernel.dk>
Newsgroups linux.kernel
Subject Re: [PATCH] null_blk: Register as a LightNVM device
Date 2015-11-11 23:20 +0100
Message-ID <qtLUf-hJ-19@gated-at.bofh.it> (permalink)
References <qtAvM-1p6-19@gated-at.bofh.it> <qtL7Q-8bW-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 11/11/2015 02:27 PM, Jens Axboe wrote:
> 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?

Ala attached. Also fixes a leak of not freeing the ppa_cache slab cache. 
Did you try and load/reload the module? I'm thinking it would have crashed.

-- 
Jens Axboe

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] null_blk: Register as a LightNVM device Matias Bjørling <m@bjorling.me> - 2015-11-11 11:10 +0100
  Re: [PATCH] null_blk: Register as a LightNVM device Jens Axboe <axboe@kernel.dk> - 2015-11-11 22:30 +0100
    Re: [PATCH] null_blk: Register as a LightNVM device Jens Axboe <axboe@kernel.dk> - 2015-11-11 23:20 +0100
      Re: [PATCH] null_blk: Register as a LightNVM device Matias Bjørling <m@bjorling.me> - 2015-11-12 12:40 +0100
  Re: [PATCH] null_blk: Register as a LightNVM device Christoph Hellwig <hch@infradead.org> - 2015-11-12 10:00 +0100
    Re: [PATCH] null_blk: Register as a LightNVM device Jens Axboe <axboe@kernel.dk> - 2015-11-12 16:50 +0100
      Re: [PATCH] null_blk: Register as a LightNVM device Christoph Hellwig <hch@infradead.org> - 2015-11-12 17:00 +0100
        Re: [PATCH] null_blk: Register as a LightNVM device Jens Axboe <axboe@fb.com> - 2015-11-12 17:10 +0100
          Re: [PATCH] null_blk: Register as a LightNVM device Matias Bjørling <m@bjorling.me> - 2015-11-12 19:30 +0100
      Re: [PATCH] null_blk: Register as a LightNVM device Jens Axboe <axboe@fb.com> - 2015-11-12 17:00 +0100
      Re: [PATCH] null_blk: Register as a LightNVM device Christoph Hellwig <hch@infradead.org> - 2015-11-12 17:00 +0100

csiph-web