lkml.org 
[lkml]   [2012]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/9] block: implement bio_associate_current()
Hello, Kent.

On Thu, Feb 16, 2012 at 05:19:07PM -0800, Kent Overstreet wrote:
> On Thu, Feb 16, 2012 at 02:37:56PM -0800, Tejun Heo wrote:
> > This patch implements bio_associate_current() which associates the
> > specified bio with %current. The bio will record the associated ioc
> > and blkcg at that point and block layer will use the recorded ones
> > regardless of which task actually ends up issuing the bio. bio
> > release puts the associated ioc and blkcg.
>
> Excellent.
>
> Why not have bio_associate_current() called from submit_bio()? I would
> expect that's what we want most of the time, and the places it's not
> (mainly writeback) calling it before submit_bio() would do the right
> thing.
>
> It'd make things more consistent - rq_ioc() could be dropped, and
> incorrect usage would be more obvious.

Yeah, maybe, I was mostly trying to avoid adding extra operations on
common paths as explicit task association isn't that common, at least
for now. That said, I agree that things can be much cleaner just
allocating and associating stuff upfront - ie. always have ioc and
associate blkcg with IOs on issue.

If the associated blkcg is used consistently through block layer, it
might be better but cfq doesn't even do that. It has its own icq ->
blkcg mapping, which it initializes on first cfqq association. It
even ignores tasks migrating to a different cgroup and keeps using
whatever cgroup the task first issued IOs on. :(

I don't know. Maybe someday.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2012-02-17 23:17    [W:0.055 / U:3.780 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site