From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752584AbbKKV1j (ORCPT ); Wed, 11 Nov 2015 16:27:39 -0500 Received: from mail-ig0-f178.google.com ([209.85.213.178]:32899 "EHLO mail-ig0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046AbbKKV1h (ORCPT ); Wed, 11 Nov 2015 16:27:37 -0500 Subject: Re: [PATCH] null_blk: Register as a LightNVM device To: =?UTF-8?Q?Matias_Bj=c3=b8rling?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1447236398-9421-1-git-send-email-m@bjorling.me> Cc: axboe@fb.com From: Jens Axboe Message-ID: <5643B2C6.9010400@kernel.dk> Date: Wed, 11 Nov 2015 14:27:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447236398-9421-1-git-send-email-m@bjorling.me> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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