All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Thornber <thornber@redhat.com>
To: Thanos Makatos <thanos.makatos@sunlight.io>
Cc: dm-devel@redhat.com
Subject: Re: extracting thin mappings in real time
Date: Wed, 3 Oct 2018 15:47:21 +0100	[thread overview]
Message-ID: <20181003144720.GC20800@reti> (raw)
In-Reply-To: <CA+fs2JN0FHg_ZGawUACWbJPfCpna1fi7PAMzDem2viNZ-zSthQ@mail.gmail.com>

On Wed, Oct 03, 2018 at 03:13:36PM +0100, Thanos Makatos wrote:
> > Could you say more about why you want to do this?
> >
> 
> So that I can directly read the data block without having to pass through
> dm-thin, e.g. there might be a more direct datapath to the physical block
> device.
> 
> Mappings don't change if you're not using snapshots.  If you are, then any
> > write
> > to a shared block will trigger a copy on write operation, and subsequently
> > a new
> > mapping.
> 
> So for backups etc. I made the metadata snapshot available, which gives you
> > a
> > view of all the metadata frozen at a point in time.  If you're using the
> > metadata
> > snap you still need to guarantee the mappings for the devices that you're
> > interested
> > in are not changing.  eg, instead of backing up a live thin, take a
> > snapshot of the thin
> > and back this up instead.
> >
> 
> For now I can guarantee that these mappings don't change (no snapshots,
> backups, etc), so it's safe to extract the mapping(s) without having
> acquired the meradata snapshot, correct? If this is the case, then how can
> I extract individual mappins? (Either from kernel space or from user
> space.) Are there specific dm-thin kernel functions I should start looking
> at?

Why is this thin-specific?  What happens if there are two thin-pools under
your code?  Do you want the final physical location?  The whole dm stack?

Efficiently reading the metadata requires a cache of metadata blocks.  Thinp uses dm-bufio
to provide this.  It seems very wasteful for you to duplicate this.  So your options are:


i) querying the pool metadata object directly.  Currently there is no way to get hold of the
   metadata object, you would need to make any queries off the io path, since they can block.

ii) or examining the completed bios, you'd probably need to add some per bio data to give context.  

- Joe

  reply	other threads:[~2018-10-03 14:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 12:40 extracting thin mappings in real time Thanos Makatos
2018-10-03 13:03 ` Joe Thornber
2018-10-03 14:13   ` Thanos Makatos
2018-10-03 14:47     ` Joe Thornber [this message]
2018-10-03 15:47       ` Thanos Makatos
2018-10-04 12:56         ` Joe Thornber
2018-10-05 11:33           ` Thanos Makatos
2018-10-05 15:53             ` Thanos Makatos

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=20181003144720.GC20800@reti \
    --to=thornber@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=thanos.makatos@sunlight.io \
    /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.