From: Mike Snitzer <snitzer@redhat.com>
To: "Matias Bjørling" <m@bjorling.me>
Cc: agk@redhat.com, dm-devel@redhat.com, neilb@suse.de,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC v1 01/01] dm-lightnvm: An open FTL for open firmware SSDs
Date: Fri, 21 Mar 2014 11:09:42 -0400 [thread overview]
Message-ID: <20140321150942.GA29731@redhat.com> (raw)
In-Reply-To: <1395383538-18019-2-git-send-email-m@bjorling.me>
On Fri, Mar 21 2014 at 2:32am -0400,
Matias Bjørling <m@bjorling.me> wrote:
> LightNVM implements the internal logic of an SSD within the host system.
> This includes logic such as translation tables for logical to physical
> address translation, garbage collection and wear-leveling.
>
> It is designed to be used either standalone or with a LightNVM
> compatible firmware. If used standalone, NVM memory can be simulated
> by passing timings to the dm target table. If used with a LightNVM
> compatible device, the device will be queued upon initialized for the
> relevant values.
>
> The last part is still in progress and a fully working prototype will be
> presented in upcoming patches.
>
> Contributions to make this possible by the following people:
>
> Aviad Zuck <aviadzuc@tau.ac.il>
> Jesper Madsen <jmad@itu.dk>
>
> Signed-off-by: Matias Bjorling <m@bjorling.me>
...
> diff --git a/drivers/md/lightnvm/core.c b/drivers/md/lightnvm/core.c
> new file mode 100644
> index 0000000..113fde9
> --- /dev/null
> +++ b/drivers/md/lightnvm/core.c
> @@ -0,0 +1,705 @@
> +#include "lightnvm.h"
> +
> +/* alloc pbd, but also decorate it with bio */
> +static struct per_bio_data *alloc_init_pbd(struct nvmd *nvmd, struct bio *bio)
> +{
> + struct per_bio_data *pb = mempool_alloc(nvmd->per_bio_pool, GFP_NOIO);
> +
> + if (!pb) {
> + DMERR("Couldn't allocate per_bio_data");
> + return NULL;
> + }
> +
> + pb->bi_end_io = bio->bi_end_io;
> + pb->bi_private = bio->bi_private;
> +
> + bio->bi_private = pb;
> +
> + return pb;
> +}
> +
> +static void free_pbd(struct nvmd *nvmd, struct per_bio_data *pb)
> +{
> + mempool_free(pb, nvmd->per_bio_pool);
> +}
> +
> +/* bio to be stripped from the pbd structure */
> +static void exit_pbd(struct per_bio_data *pb, struct bio *bio)
> +{
> + bio->bi_private = pb->bi_private;
> + bio->bi_end_io = pb->bi_end_io;
> +}
> +
Hi Matias,
This looks like it'll be very interesting! But I won't have time to do
a proper review of this code for ~1.5 weeks (traveling early next week
and then need to finish some high priority work on dm-thin once I'm
back).
But a couple quick things I noticed:
1) you don't need to roll your own per-bio-data allocation code any
more. The core block layer provides per_bio_data now.
And the DM targets have been converted to make use of it. See callers
of dm_per_bio_data() and how the associated targets set
ti->per_bio_data_size
2) Also, if you're chaining bi_end_io (like it appears you're doing)
you'll definitely need to call atomic_inc(&bio->bi_remaining); after you
restore bio->bi_end_io. This is a new requirement of the 3.14 kernel
(due to the block core's immutable biovec changes).
Please sort these issues out, re-test on 3.14, and post v2, thanks!
Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-03-21 15:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 6:32 [PATCH RFC v1 00/01] dm-lightnvm introduction Matias Bjørling
2014-03-21 6:32 ` [PATCH RFC v1 01/01] dm-lightnvm: An open FTL for open firmware SSDs Matias Bjørling
2014-03-21 15:09 ` Mike Snitzer [this message]
2014-03-21 15:26 ` Matias Bjorling
2014-03-21 15:37 ` Christoph Hellwig
2014-03-21 16:24 ` Matias Bjorling
2014-03-25 2:22 ` [dm-devel] " Akira Hayakawa
2014-03-25 3:45 ` Matias Bjorling
2014-03-24 6:13 ` Bart Van Assche
2014-03-25 3:30 ` Matias Bjorling
2014-03-25 11:38 ` Takashi HOSHINO
2014-03-21 9:06 ` [dm-devel] [PATCH RFC v1 00/01] dm-lightnvm introduction Joe Thornber
2014-03-21 15:22 ` Matias Bjorling
2014-03-25 3:08 ` David Lang
2014-03-25 3:56 ` Matias Bjorling
2014-03-25 17:23 ` Richard Weinberger
2014-03-21 15:32 ` Richard Weinberger
2014-03-21 16:42 ` Matias Bjorling
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=20140321150942.GA29731@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m@bjorling.me \
--cc=neilb@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).