All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <m@bjorling.me>
To: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: axboe@fb.com
Subject: Re: [PATCH] null_blk: Register as a LightNVM device
Date: Thu, 12 Nov 2015 12:30:11 +0100	[thread overview]
Message-ID: <56447843.4000804@bjorling.me> (raw)
In-Reply-To: <5643BD05.8000007@kernel.dk>

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

Good idea. I'll apply it. Thanks

  reply	other threads:[~2015-11-12 11:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 10:06 [PATCH] null_blk: Register as a LightNVM device Matias Bjørling
2015-11-11 21:27 ` Jens Axboe
2015-11-11 22:11   ` Jens Axboe
2015-11-12 11:30     ` Matias Bjørling [this message]
2015-11-12  8:53 ` Christoph Hellwig
2015-11-12 15:49   ` Jens Axboe
2015-11-12 15:52     ` Christoph Hellwig
2015-11-12 15:54       ` Jens Axboe
2015-11-12 15:58         ` Christoph Hellwig
2015-11-12 16:00           ` Jens Axboe
2015-11-12 18:29             ` Matias Bjørling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56447843.4000804@bjorling.me \
    --to=m@bjorling.me \
    --cc=axboe@fb.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.