[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [dm-devel] [PATCH 1/2] dm-kcopyd: introduce per-module throttle structure

On Fri, Jun 10, 2011 at 09:44:25AM +0100, Joe Thornber wrote:
> On Thu, Jun 09, 2011 at 12:08:08PM -0400, Mikulas Patocka wrote:
> > 
> > 
> > On Thu, 9 Jun 2011, Joe Thornber wrote:
> > > What we're trying to do is avoid kcopyd issuing so much io that it
> > > interferes with userland io.
> > 
> > But you don't know if there is some userland IO or not to the same disk.
> None the less, this was the motivation Alasdair gave for wanting this
> throttling.

Not sure if it helps,
but are you familiar with the MD raid rebuild throttling?

see is_mddev_idle() in drivers/md/md.c

It basically looks at read/write sector part_stats, and tracks its
own resync IO issued to the disk in question (in the special
gendisk member sync_io -- you'd probably need to use your own
counter in some other kcopyd context struct).

Then it figures, if there is "significant" increase in the
partition stats that cannot be accounted for by its own resync IO,
that should be userland IO, which means the device is not idle.

Then it has minimum and maximum bandwidth limits.
It won't use up more than maximum bandwidth,
even if the disk(s) seem to be idle.

If the disk seems to be NOT idle, it still would only throttle,
if its current estimated resync bandwidth is above the minimum
bandwidth limit.

Maybe a similar algorithm could be used for kcopyd?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]