linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Toshi Kani <toshi.kani@hpe.com>
Cc: linux-nvdimm@ml01.01.org, linux-kernel@vger.kernel.org,
	linux-raid@vger.kernel.org, dm-devel@redhat.com,
	Dan Williams <dan.j.williams@intel.com>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	Alasdair Kergon <agk@redhat.com>
Subject: Re: dm stripe: add DAX support
Date: Fri, 24 Jun 2016 14:29:00 -0400	[thread overview]
Message-ID: <20160624182859.GD13898@redhat.com> (raw)
In-Reply-To: <1466792610-30369-1-git-send-email-toshi.kani@hpe.com>

On Fri, Jun 24 2016 at  2:23pm -0400,
Toshi Kani <toshi.kani@hpe.com> wrote:

> Change dm-stripe to implement direct_access function,
> stripe_direct_access(), which maps bdev and sector and
> calls direct_access function of its physical target device.
> 
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> Cc: Alasdair Kergon <agk@redhat.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> ---
>  drivers/md/dm-stripe.c |   25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
> index 48f1c01..8925f6a 100644
> --- a/drivers/md/dm-stripe.c
> +++ b/drivers/md/dm-stripe.c
> @@ -308,6 +308,30 @@ static int stripe_map(struct dm_target *ti, struct bio *bio)
>  	return DM_MAPIO_REMAPPED;
>  }
>  
> +static long stripe_direct_access(struct dm_target *ti, sector_t sector,
> +		void __pmem **kaddr, pfn_t *pfn, long size)
> +{
> +	struct stripe_c *sc;
> +	struct block_device *bdev;
> +	uint32_t stripe;
> +	struct blk_dax_ctl dax = {
> +		.size = size,
> +	};
> +	long ret;
> +
> +	sc = ti->private;
> +	stripe_map_sector(sc, sector, &stripe, &dax.sector);
> +
> +	dax.sector += sc->stripe[stripe].physical_start;
> +	bdev = sc->stripe[stripe].dev->bdev;
> +
> +	ret = bdev_direct_access(bdev, &dax);
> +	*kaddr = dax.addr;
> +	*pfn = dax.pfn;
> +
> +	return ret;
> +}
> +
>  /*
>   * Stripe status:
>   *
> @@ -425,6 +449,7 @@ static struct target_type stripe_target = {
>  	.status = stripe_status,
>  	.iterate_devices = stripe_iterate_devices,
>  	.io_hints = stripe_io_hints,
> +	.direct_access = stripe_direct_access,
>  };
>  
>  int __init dm_stripe_init(void)

Thanks, once jens queues the block changes I'll be able to pull this in
to linux-dm.git

BTW, if in your testing you could evaluate/quantify any extra overhead
from DM that'd be useful to share.  It could be there are bottlenecks
that need to be fixed, etc.

Mike

  reply	other threads:[~2016-06-24 18:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 18:23 [PATCH] dm stripe: add DAX support Toshi Kani
2016-06-24 18:29 ` Mike Snitzer [this message]
2016-06-24 18:42   ` Kani, Toshimitsu
2016-07-12 22:22   ` Kani, Toshimitsu
2016-07-13  2:01     ` Mike Snitzer
2016-07-13 15:03       ` Kani, Toshimitsu
2016-07-21  0:01         ` Mike Snitzer
2016-07-21  3:03           ` Jens Axboe
2016-06-24 19:58 ` [PATCH] " kbuild test robot
2016-06-24 20:02   ` Mike Snitzer
2016-06-24 20:46     ` Kani, Toshimitsu
2016-06-24 19:59 ` [PATCH] " kbuild test robot

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=20160624182859.GD13898@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=ross.zwisler@linux.intel.com \
    --cc=toshi.kani@hpe.com \
    /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).