lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180831231609.GD1488037@devbig004.ftw2.facebook.com>
Date:   Fri, 31 Aug 2018 16:16:09 -0700
From:   Tejun Heo <tj@...nel.org>
To:     Dennis Zhou <dennisszhou@...il.com>
Cc:     Jens Axboe <axboe@...nel.dk>, Johannes Weiner <hannes@...xchg.org>,
        Josef Bacik <josef@...icpanda.com>, kernel-team@...com,
        linux-block@...r.kernel.org, cgroups@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 06/15] blkcg: always associate a bio with a blkg

Hello,

On Thu, Aug 30, 2018 at 09:53:47PM -0400, Dennis Zhou wrote:
> From: "Dennis Zhou (Facebook)" <dennisszhou@...il.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

> +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?

Other than that,

Acked-by: Tejun Heo <tj@...nel.org>

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ