From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, Edward Thornber <thornber@redhat.com>
Subject: Re: questions about dm-thin and discard
Date: Mon, 16 Jul 2012 14:01:42 -0400 [thread overview]
Message-ID: <20120716180141.GA7988@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1207161302450.22760@file.rdu.redhat.com>
On Mon, Jul 16 2012 at 1:14pm -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:
> Hi Joe
>
> I would like to ask you about this code path: In process_discard, there is
> a branch with a comment "This path is hit if people are ignoring
> limits->discard_granularity." It trims the discard request so that it
> doesn't span a block boundary and submits it.
>
> The question is: what if the block is shared? In this case, we can't
> submit discard to the block, because it would damage the other snapshot
> that is sharing this block. Shouldn't there be shomething like this?
> if ((!lookup_result.shared) & pool->pf.discard_passdown) {
> remap_and_issue(tc, bio, lookup_result.block);
> } else {
> bio_endio(bio, 0)
> }
> ... or is it tested elsewhere and am I missing something?
in process_discard:
m->pass_discard = (!lookup_result.shared) && pool->pf.disard_passdown;
then in process_prepared_discard:
if (m->pass_discard)
remap_and_issue(tc, m->bio, m->data_block);
else
bio_endio(m->bio, 0);
> Another question is about setting "ti->discards_supported = 1" in
> pool_ctr. ti->discards_supported means that the target supports discards
> even if the underlying disk doesn't. Since the pool device is passing
> anyth I/O unchanged to the underlying disk, ti->discards_supported
> shouldn't be set. Or is there any other reason why is it set?
The thin device's bios will be remapped to the pool device.
process_prepared_discard's remap_and_issue() will send the bio to the
pool device via generic_make_request().
next prev parent reply other threads:[~2012-07-16 18:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-16 17:14 questions about dm-thin and discard Mikulas Patocka
2012-07-16 18:01 ` Mike Snitzer [this message]
2012-07-16 18:32 ` Mikulas Patocka
2012-07-16 19:51 ` Mike Snitzer
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=20120716180141.GA7988@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mpatocka@redhat.com \
--cc=thornber@redhat.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 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.