lkml.org 
[lkml]   [2018]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/15] blkcg: always associate a bio with a blkg
On Fri, Aug 31, 2018 at 04:16:09PM -0700, Tejun Heo wrote:
> Hello,
>
> On Thu, Aug 30, 2018 at 09:53:47PM -0400, Dennis Zhou wrote:
> > From: "Dennis Zhou (Facebook)" <dennisszhou@gmail.com>
> >
> > Previously, blkg's were only assigned as needed by blk-iolatency and
> > blk-throttle. bio->css was also always being associated while blkg was
> > being looked up and then thrown away in blkcg_bio_issue_check.
> >
> > This patch beings the cleanup of bio->css and bio->bi_blkg by always
> ^
> begins
>

Thanks!

> > +int bio_associate_create_blkg(struct request_queue *q, struct bio *bio)
> > +{
> > + struct blkcg *blkcg;
> > + struct blkcg_gq *blkg;
> > + int ret = 0;
> > +
> > + /* someone has already associated this bio with a blkg */
> > + if (bio->bi_blkg)
> > + return ret;
> > +
> > + rcu_read_lock();
> > +
> > + bio_associate_blkcg(bio, NULL);
> > + blkcg = bio_blkcg(bio);
> > +
> > + if (!blkcg->css.parent) {
> > + ret = bio_associate_blkg(bio, q->root_blkg);
> > + goto assoc_out;
> > + }
> > +
> > + blkg = blkg_lookup_create(blkcg, q);
> > + if (IS_ERR(blkg))
> > + blkg = q->root_blkg;
> > +
> > + ret = bio_associate_blkg(bio, blkg);
> > +assoc_out:
>
> Maybe if/else instead of goto?
>

Yeah, no need for goto.

Thanks,
Dennis

\
 
 \ /
  Last update: 2018-09-06 22:43    [W:0.096 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site