All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars Ellenberg <lars.ellenberg@linbit.com>
To: Joe Thornber <thornber@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Mikulas Patocka <mpatocka@redhat.com>,
	"Alasdair G. Kergon" <agk@redhat.com>
Subject: Re: [PATCH 1/2] dm-kcopyd: introduce per-module throttle structure
Date: Fri, 10 Jun 2011 18:13:30 +0200	[thread overview]
Message-ID: <20110610161330.GH22211@barkeeper1-xen.linbit> (raw)
In-Reply-To: <20110610134759.GA10908@ubuntu>

On Fri, Jun 10, 2011 at 02:48:00PM +0100, Joe Thornber wrote:
> On Fri, Jun 10, 2011 at 09:41:50AM -0400, Mikulas Patocka wrote:
> > This works if the data is directly on the partition, but it won't work on 
> > the device mapper (if MD is on the device mapper, it won't work too).
> > 
> > The device mapper has no function to tell where the bio is finally 
> > remapped, so you can't read disk statistics for that particular disk.
> 
> ok, thx

Right, you do not know which phyical device the IO may end up on,
if it passes through several stacking layers.

But even if that would be desirable in the long term,
it may not be necessary right now? [*]

Jobs on one mapping would not notice that the same physical device may
be busy via some other mapping.

But at least it would notice user (ok, non-kcopyd) IO on the same source
or destination mapping(s), which is a big improvement already, compared
with completely ignoring what is going on?

struct kcopyd_job {
   ...
   struct dm_io_region source;
   struct dm_io_region dests[...];
   ...
}

struct dm_io_region {
   struct block_device *bdev;
   ...
}

struct block_device {
   ...
   struct gendisk *bd_disk;
   ...
}

struct gendisk {
   ...
   struct hd_struct part0;   <--- there live the stats.
   ...
}

[*]
/me wildly handwaving
That could be solved, if we want to.
Add to block_device_operations:
   struct gendisk * (*get_lower_level_gendisk)(struct gendisk*);


struct gendisk *appropriate_function_name(struct gendisk *d)
{
	while (d->fops->get_lower_level_gendisk)
		d = d->fops->get_lower_level_gendisk(d);
	return d;
}

Then have some convenience functions part_stat_read_lowest_level(...).

May have come up before, probably was rejected because of uglyness?

  ;-)


	Lars

  reply	other threads:[~2011-06-10 16:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31 22:03 [PATCH 1/2] dm-kcopyd: introduce per-module throttle structure Mikulas Patocka
2011-06-01  6:18 ` Ankit Jain
2011-06-01  7:13   ` Ankit Jain
2011-06-02 19:16   ` Mikulas Patocka
2011-06-01  9:51 ` Joe Thornber
2011-06-02 19:55   ` Mikulas Patocka
2011-06-03 11:01     ` Joe Thornber
2011-06-03 15:54       ` Mike Snitzer
2011-06-07 17:50       ` Mikulas Patocka
2011-06-09  9:47         ` Joe Thornber
2011-06-09 16:08           ` Mikulas Patocka
2011-06-09 16:27             ` Alasdair G Kergon
2011-06-10  8:44             ` Joe Thornber
2011-06-10  9:28               ` Lars Ellenberg
2011-06-10 10:14                 ` Joe Thornber
2011-06-10 13:41                   ` Mikulas Patocka
2011-06-10 13:48                     ` Joe Thornber
2011-06-10 16:13                       ` Lars Ellenberg [this message]
2011-06-10 13:51                     ` Mike Snitzer
2011-06-11 20:27               ` Mikulas Patocka
2011-06-13  9:17                 ` Joe Thornber
2011-06-13 21:06                   ` Mikulas Patocka
2011-06-14  8:34                     ` 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=20110610161330.GH22211@barkeeper1-xen.linbit \
    --to=lars.ellenberg@linbit.com \
    --cc=agk@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.