linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Support for global block IO throttling?
@ 2011-03-23 13:48 Juerg Haefliger
  2011-03-23 14:25 ` Vivek Goyal
  0 siblings, 1 reply; 7+ messages in thread
From: Juerg Haefliger @ 2011-03-23 13:48 UTC (permalink / raw)
  To: LKML

Hi,

Are there any plans to support global (per cgroup) IO throttling in
the near future? I'm in need of this and would gladly work on it if
nobody else is and if people think this is a useful feature. What I
envision is that one can specify the limits of individual devices in a
group but also specify the overall aggregate limit of the whole group.
I just started looking at the throttling code and haven't quite
figured it out yet so it might take me a bit to get up to speed.

Thanks
...Juerg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for global block IO throttling?
  2011-03-23 13:48 Support for global block IO throttling? Juerg Haefliger
@ 2011-03-23 14:25 ` Vivek Goyal
  2011-03-23 14:39   ` Juerg Haefliger
  0 siblings, 1 reply; 7+ messages in thread
From: Vivek Goyal @ 2011-03-23 14:25 UTC (permalink / raw)
  To: Juerg Haefliger; +Cc: LKML

On Wed, Mar 23, 2011 at 02:48:18PM +0100, Juerg Haefliger wrote:
> Hi,
> 
> Are there any plans to support global (per cgroup) IO throttling in
> the near future? I'm in need of this and would gladly work on it if
> nobody else is and if people think this is a useful feature. What I
> envision is that one can specify the limits of individual devices in a
> group but also specify the overall aggregate limit of the whole group.
> I just started looking at the throttling code and haven't quite
> figured it out yet so it might take me a bit to get up to speed.

Hi Juerg,

What's the use case? Why do you need global block IO throttling?

Thanks
Vivek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for global block IO throttling?
  2011-03-23 14:25 ` Vivek Goyal
@ 2011-03-23 14:39   ` Juerg Haefliger
  2011-03-23 14:54     ` Vivek Goyal
  0 siblings, 1 reply; 7+ messages in thread
From: Juerg Haefliger @ 2011-03-23 14:39 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: LKML

Hi Vivek,

>> Are there any plans to support global (per cgroup) IO throttling in
>> the near future? I'm in need of this and would gladly work on it if
>> nobody else is and if people think this is a useful feature. What I
>> envision is that one can specify the limits of individual devices in a
>> group but also specify the overall aggregate limit of the whole group.
>> I just started looking at the throttling code and haven't quite
>> figured it out yet so it might take me a bit to get up to speed.
>
> Hi Juerg,
>
> What's the use case? Why do you need global block IO throttling?

Resource management for guest VMs. I want to make sure a VM cannot
exceed a certain IO limit. If the VM does IOs to only one device, it
gets the full specified bandwidth to that single device but if the VM
talks to multiple devices, it only gets a fraction of the global
bandwidth per device, not exceeded the global limit.

...Juerg


> Thanks
> Vivek
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for global block IO throttling?
  2011-03-23 14:39   ` Juerg Haefliger
@ 2011-03-23 14:54     ` Vivek Goyal
  2011-03-24  7:17       ` Juerg Haefliger
  2011-04-01  8:05       ` Juerg Haefliger
  0 siblings, 2 replies; 7+ messages in thread
From: Vivek Goyal @ 2011-03-23 14:54 UTC (permalink / raw)
  To: Juerg Haefliger; +Cc: LKML

On Wed, Mar 23, 2011 at 03:39:28PM +0100, Juerg Haefliger wrote:
> Hi Vivek,
> 
> >> Are there any plans to support global (per cgroup) IO throttling in
> >> the near future? I'm in need of this and would gladly work on it if
> >> nobody else is and if people think this is a useful feature. What I
> >> envision is that one can specify the limits of individual devices in a
> >> group but also specify the overall aggregate limit of the whole group.
> >> I just started looking at the throttling code and haven't quite
> >> figured it out yet so it might take me a bit to get up to speed.
> >
> > Hi Juerg,
> >
> > What's the use case? Why do you need global block IO throttling?
> 
> Resource management for guest VMs. I want to make sure a VM cannot
> exceed a certain IO limit. If the VM does IOs to only one device, it
> gets the full specified bandwidth to that single device but if the VM
> talks to multiple devices, it only gets a fraction of the global
> bandwidth per device, not exceeded the global limit.

Can't we specify per device limit for VM if VM is doing IO to multiple
devices?

I know it is not exact replacement of global limits as one has to know
the topology and figure out to what all devices IO is happening. This
might get even more difficult if VM's disk is a file on filesystem on
host and not a device directly eported to guest.

Somebody also had mentioned that if we have mutiple layers of qemu
snapshots and if snapshots are sitting on different logical devices
then it becomes hard to figure out where all VM traffic is going
and how to even divide global limits in per device limits 

Also current IO controller does not work for NFS. So if a global limit
is imposed in higher layers it will solve that issue too.

Also if you implement it above page cache then it should automatically
handle the case of async writes too. The downside is that if limits
are low, buffered writers will be throttled very frequently.

So in general, I think global limits is a useful concept. Do you have
a implementation ready?

Thanks
Vivek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for global block IO throttling?
  2011-03-23 14:54     ` Vivek Goyal
@ 2011-03-24  7:17       ` Juerg Haefliger
  2011-04-01  8:05       ` Juerg Haefliger
  1 sibling, 0 replies; 7+ messages in thread
From: Juerg Haefliger @ 2011-03-24  7:17 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: LKML

>> Hi Vivek,
>>
>> >> Are there any plans to support global (per cgroup) IO throttling in
>> >> the near future? I'm in need of this and would gladly work on it if
>> >> nobody else is and if people think this is a useful feature. What I
>> >> envision is that one can specify the limits of individual devices in a
>> >> group but also specify the overall aggregate limit of the whole group.
>> >> I just started looking at the throttling code and haven't quite
>> >> figured it out yet so it might take me a bit to get up to speed.
>> >
>> > Hi Juerg,
>> >
>> > What's the use case? Why do you need global block IO throttling?
>>
>> Resource management for guest VMs. I want to make sure a VM cannot
>> exceed a certain IO limit. If the VM does IOs to only one device, it
>> gets the full specified bandwidth to that single device but if the VM
>> talks to multiple devices, it only gets a fraction of the global
>> bandwidth per device, not exceeded the global limit.
>
> Can't we specify per device limit for VM if VM is doing IO to multiple
> devices?

Yes we can but it's not exact. As I mentioned, the way I want to
specify it is so that the VMs alloted bandwidth is shared across all
the drives presented to that VM.

> I know it is not exact replacement of global limits as one has to know
> the topology and figure out to what all devices IO is happening. This
> might get even more difficult if VM's disk is a file on filesystem on
> host and not a device directly eported to guest.
>
> Somebody also had mentioned that if we have mutiple layers of qemu
> snapshots and if snapshots are sitting on different logical devices
> then it becomes hard to figure out where all VM traffic is going
> and how to even divide global limits in per device limits
>
> Also current IO controller does not work for NFS. So if a global limit
> is imposed in higher layers it will solve that issue too.
>
> Also if you implement it above page cache then it should automatically
> handle the case of async writes too. The downside is that if limits
> are low, buffered writers will be throttled very frequently.
>
> So in general, I think global limits is a useful concept. Do you have
> a implementation ready?

Err... No... I was hoping the community can give me some pointers and
infos to get me started. Just like the details you mentioned above
which are very useful.

Thanks
...Juerg


> Thanks
> Vivek
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for global block IO throttling?
  2011-03-23 14:54     ` Vivek Goyal
  2011-03-24  7:17       ` Juerg Haefliger
@ 2011-04-01  8:05       ` Juerg Haefliger
  2011-04-01 13:58         ` Vivek Goyal
  1 sibling, 1 reply; 7+ messages in thread
From: Juerg Haefliger @ 2011-04-01  8:05 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: LKML

Hi Vivek,


> Also current IO controller does not work for NFS. So if a global limit
> is imposed in higher layers it will solve that issue too.
>
> Also if you implement it above page cache then it should automatically
> handle the case of async writes too. The downside is that if limits
> are low, buffered writers will be throttled very frequently.

I'm not exactly sure where in the stack you see this global bandwidth
controller. What do you mean by 'above the page cache'? I interpret
this such that access to the page cache would be bandwidth limited as
well? That doesn't sound right to me.

Thanks
...Juerg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for global block IO throttling?
  2011-04-01  8:05       ` Juerg Haefliger
@ 2011-04-01 13:58         ` Vivek Goyal
  0 siblings, 0 replies; 7+ messages in thread
From: Vivek Goyal @ 2011-04-01 13:58 UTC (permalink / raw)
  To: Juerg Haefliger; +Cc: LKML

On Fri, Apr 01, 2011 at 10:05:41AM +0200, Juerg Haefliger wrote:
> Hi Vivek,
> 
> 
> > Also current IO controller does not work for NFS. So if a global limit
> > is imposed in higher layers it will solve that issue too.
> >
> > Also if you implement it above page cache then it should automatically
> > handle the case of async writes too. The downside is that if limits
> > are low, buffered writers will be throttled very frequently.
> 
> I'm not exactly sure where in the stack you see this global bandwidth
> controller. What do you mean by 'above the page cache'? I interpret
> this such that access to the page cache would be bandwidth limited as
> well? That doesn't sound right to me.

You are right. For reads it will not make sense to implement it above
page cache as reads coming out of page cache need not be throttled.

So it will probably boil down to that implement buffered write throttling
when entring the page cache and read throttling somewhere below.
generic_make_request()? But that will not take care of network file system
case I think. 

May be we can enhance blk_throtl_bio() itself to also check for global
rules and subject bio to first global rules and put in a global
queue. This probably will work for your virtual machine cases but
it does not take care of buffered writes and NFS IO. May be that is
still a good first step towards global IO limit implementation.

Thanks
Vivek

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-04-01 13:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-23 13:48 Support for global block IO throttling? Juerg Haefliger
2011-03-23 14:25 ` Vivek Goyal
2011-03-23 14:39   ` Juerg Haefliger
2011-03-23 14:54     ` Vivek Goyal
2011-03-24  7:17       ` Juerg Haefliger
2011-04-01  8:05       ` Juerg Haefliger
2011-04-01 13:58         ` Vivek Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).