From: Joe Thornber <thornber@redhat.com>
To: Milan Broz <mbroz@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>,
"Alasdair G. Kergon" <agk@redhat.com>
Subject: Re: [PATCH] dm-kcopyd/dm-snap: Don't read the origin on full chunk write
Date: Mon, 20 Jun 2011 11:03:13 +0100 [thread overview]
Message-ID: <20110620100312.GB5388@ubuntu> (raw)
In-Reply-To: <4DFF1829.7050909@redhat.com>
On Mon, Jun 20, 2011 at 11:51:37AM +0200, Milan Broz wrote:
> On 06/20/2011 10:09 AM, Joe Thornber wrote:
> For the nack - I do not get it.
> Joe, please can you explain the reasons?
You know the size of the bio when you submit it. So you're saying to
kcopyd, do this copy, except if it's a particular size, then don't,
just issue the io. I don't see from Mikulas' description why kcopyd
needs to be involved in this.
For instance here's how multisnap handles it:
if (io_covers_block(pool, bio)) {
/* no copy needed, since all data is going to change */
m->bio = bio;
m->bi_end_io = bio->bi_end_io;
m->bi_private = bio->bi_private;
bio->bi_end_io = overwrite_complete;
bio->bi_private = m;
remap_and_issue(pool, bio, data_dest);
} else {
/* use kcopyd */
struct dm_io_region from, to;
from.bdev = pool->pool_dev;
from.sector = data_origin * pool->sectors_per_block;
from.count = pool->sectors_per_block;
to.bdev = pool->pool_dev;
to.sector = data_dest * pool->sectors_per_block;
to.count = pool->sectors_per_block;
r = dm_kcopyd_copy(pool->copier, &from, 1, &to,
0, copy_complete, m);
if (r < 0) {
mempool_free(m, pool->mapping_pool);
printk(KERN_ALERT "dm_kcopyd_copy() failed");
cell_error(cell);
}
}
I don't see why we want to wait for a context switch to kcopyd in
order to issue an io.
If this is about avoiding having to hook the bio endio function then
why use kcopyd rather than dm-io? (I'm not advocating this, just
asking the question).
- Joe
next prev parent reply other threads:[~2011-06-20 10:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-17 12:32 [PATCH] dm-kcopyd/dm-snap: Don't read the origin on full chunk write Mikulas Patocka
2011-06-20 8:09 ` Joe Thornber
2011-06-20 9:51 ` Milan Broz
2011-06-20 10:03 ` Joe Thornber [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-06-24 0:25 Mikulas Patocka
2011-06-24 0:51 ` Alasdair G Kergon
2011-06-24 7:35 ` Joe Thornber
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=20110620100312.GB5388@ubuntu \
--to=thornber@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mbroz@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.