lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56447843.4000804@bjorling.me>
Date:	Thu, 12 Nov 2015 12:30:11 +0100
From:	Matias Bjørling <m@...rling.me>
To:	Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org,
	linux-kernel@...r.kernel.org
CC:	axboe@...com
Subject: Re: [PATCH] null_blk: Register as a LightNVM device

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ