Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1120268imm; Thu, 6 Sep 2018 16:01:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZdbB/Oz6w1KWCNvsYf9x8h1fEOfBoRWDLMP2GE9VKKVdIYfRffyFqVDYNBEIgXNg1cZmdu X-Received: by 2002:a63:a54f:: with SMTP id r15-v6mr5200761pgu.336.1536274902815; Thu, 06 Sep 2018 16:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536274902; cv=none; d=google.com; s=arc-20160816; b=lypngfzH4kaM5lsQHn7nH9K+bKj9wSwxSq9Pa4NbMnar3Jvz/zDdjGhiyWxqLuwOQU +mvyjeWe9snJxlwPywnNvASjL3mem2IOeZyxQmliLRyZMHFUm3Op9F/tx+mG6YuacfTh D5v28JkVT9em+lIMKsF/ArAhCnW8ISlZ9yhUOtACredKoJfK2EGk4uJgV73hbD8lSWfH IHkPdb5fOVZsUrJxF3/R1+HmGrWw03Frj238B09llukpzpb5tfSuPFDNmVNcCqusUh6h MGz6K+CvE/VUMZineazwVNPIwdWQuJMldAowcre/KsI4nMiHoPmK1f3srJe/Jxb/AGHG wLIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KkHyODO2LSs2B8yvP42X+QdwGHycGvN193FxePG3aQk=; b=ysgEdJf8c6sAY7hgFn8V60HHQR9/ojb7prhco5JGPh1lE0y7rmomMccib7aUqE31Ee NCSGSJDg4tjSgxQLgwstI9fM1NvgHZMdK4WbMjjW7MZfTGEf2wq9/pL2w1gc7KkcUCCC 5/R1LMmkCWGHY6y7ng4dYjLuaq9A4elYKKPfNdK90eVlnxl6OMlETj24/gd5N1thPM6w U+0IZBp26wbQbtEku5VhX2OPLZgxnbyO6IRmJsYfxtDyyh1DVw7edvSVpHwGPokr0xuu jTFyZISU61gQxaE43hSl5xzQXxjtVYkOQSWXxiL4A2iEWyITkbVl64quCmBJHFq7HGBh 32rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t3T5adKY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f89-v6si5936489plf.20.2018.09.06.16.01.27; Thu, 06 Sep 2018 16:01:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t3T5adKY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730042AbeIGBTI (ORCPT + 99 others); Thu, 6 Sep 2018 21:19:08 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:41582 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbeIGBTI (ORCPT ); Thu, 6 Sep 2018 21:19:08 -0400 Received: by mail-yb1-f195.google.com with SMTP id u33-v6so4651408ybi.8; Thu, 06 Sep 2018 13:41:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KkHyODO2LSs2B8yvP42X+QdwGHycGvN193FxePG3aQk=; b=t3T5adKYRwRFPQMhEvUeP2yfGV374Fe54ZxfTYTpaTMdl7Y7B5aoD1cAf88u1HCSyf bSswgjNuTadYjutV8OEkmsXMgy2h5CI5CfEiur56DUWTQJrPdImzrEr/o4K/O7jdlvrS M6LIXbhnpQQZPRDq7W4oR4ssWeqhanK016GmxKJ48SwWX1HkCTqNyhpzgZzjeaMCyn0W Lo+mh5nNZgq46s3WXsFGc5KGvzBxMMgVYfF2Wx5u6d3d0p0bU4hH98gtv9SvWb4Tep26 0b9xAxbXCL7FuYo6SvIMuss9m+8PR6B8fyMeHOOsOh/rAYFcIa3HuN1oglz578Bq7FQF ieDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KkHyODO2LSs2B8yvP42X+QdwGHycGvN193FxePG3aQk=; b=JB0VxpXWlrK5COClYncf5MD6gf4uun7Iv5rnKa7ghEDUhgcScNHJatU+ojRRk2dUuy 4N/+al+1ZwR7S2mdI0JkZB4eq3PNohEey1C0MYZ7v0Nej9zJ8MfalOhhvJKxmiKgsepx 3ONTTEub7GZZYy431+hLgCnrqw/k/lMDvgWooPgrksy+ZrmzeuckV/tgRzSrSUx33XrN VMFW1UyhKgrWW7dPfqbl4il9IvcAbiLvR63rrykEfQbfzqKSueWsFBOLafASLbuApNys H8Hh6hgCReBxHLly93+oiY7/wcYSRsZoiDIxcK2dwr2hZl3gBeyX73ipVQbkYXLafITK XBmw== X-Gm-Message-State: APzg51B6jrCR2y/8wXrTkakbHgybRL9FqLxWaqqTA5NNC0rLv7haJqD6 0EsLlPTFkbzIgvCOszLobsM= X-Received: by 2002:a25:9111:: with SMTP id v17-v6mr2567147ybl.120.1536266516666; Thu, 06 Sep 2018 13:41:56 -0700 (PDT) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c091:200::3:20a]) by smtp.gmail.com with ESMTPSA id u124-v6sm2092273ywd.37.2018.09.06.13.41.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Sep 2018 13:41:56 -0700 (PDT) Date: Thu, 6 Sep 2018 16:41:54 -0400 From: Dennis Zhou To: Tejun Heo Cc: Jens Axboe , Johannes Weiner , Josef Bacik , kernel-team@fb.com, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/15] blkcg: always associate a bio with a blkg Message-ID: <20180906204153.GA26048@dennisz-mbp.dhcp.thefacebook.com> References: <20180831015356.69796-1-dennisszhou@gmail.com> <20180831015356.69796-7-dennisszhou@gmail.com> <20180831231609.GD1488037@devbig004.ftw2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180831231609.GD1488037@devbig004.ftw2.facebook.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)" > > > > 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