<br><br>On Wednesday, March 2, 2016, Vivek Goyal <<a href="mailto:vgoyal@redhat.com">vgoyal@redhat.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Mar 02, 2016 at 09:59:13PM +0200, Nikolay Borisov wrote:<br>
> On Wednesday, March 2, 2016, Vivek Goyal <<a href="javascript:;" onclick="_e(event, 'cvml', 'vgoyal@redhat.com')">vgoyal@redhat.com</a>> wrote:<br>
><br>
> > On Wed, Mar 02, 2016 at 08:03:10PM +0200, Nikolay Borisov wrote:<br>
> > > Thanks for the patch I will likely have time to test this sometime next<br>
> > week.<br>
> > > But just to be sure - the expected behavior would be that processes<br>
> > > writing to dm-based devices would experience the fair-shair<br>
> > > scheduling of CFQ (provided that the physical devices that back those<br>
> > > DM devices use CFQ), correct?<br>
> ><br>
> > Nikolay,<br>
> ><br>
> > I am not sure how well it will work with CFQ of underlying device. It will<br>
> > get cgroup information right for buffered writes. But cgroup information<br>
><br>
><br>
> Right, what's your definition of buffered writes?<br>
<br>
Writes which go through page cache.<br>
<br>
> My mental model is that<br>
> when a process submits a write request to a dm device , the bio is going to<br>
> be put on a devi e workqueue which would then be serviced by a background<br>
> worker thread and later the submitter notified. Do you refer to this whole<br>
> gamut of operations as buffered writes?<br>
<br>
No, once the bio is submitted to dm device it could be a buffered write or<br>
a direct write.<br>
<br>
><br>
> for reads and direct writes will come from submitter's context and if dm<br>
> > layer gets in between, then many a times submitter might be a worker<br>
> > thread and IO will be attributed to that worker's cgroup (root cgroup).<br>
><br>
><br>
> Be that as it may, proivded that the worker thread is in the 'correct'<br>
> cgroup, then the appropriate babdwidth policies should apply, no?<br>
<br>
Worker thread will most likely be in root cgroup. So if a worker thread<br>
is submitting bio, it will be attributed to root cgroup.<br>
<br>
We had similar issue with IO priority and it did not work reliably with<br>
CFQ on underlying device when dm devices were sitting on top.<br>
<br>
If we really want to give it a try, I guess we will have to put cgroup<br>
info of submitter early in bio at the time of bio creation even for all<br>
kind of IO. Not sure if it is worth the effort.<br>
<br>
For the case of IO throttling, I think you should put throttling rules on<br>
the dm device itself. That means as long as filesystem supports the<br>
cgroups, you should be getting right cgroup information for all kind of<br>
IO and throttling should work just fine.</blockquote><div><br></div><div>Throttling does work even now, but the use case I had in mind was proportional </div><div>distribution of IO. Imagine 50 or so dm devices, hosting IO intensive workloads. In</div><div>this situation, I'd be interested each of them getting proportional IO based on the weights</div><div>set in the blkcg controller for each respective cgroup for every workload.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks<br>
Vivek<br>
</blockquote>