Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp789660imm; Fri, 31 Aug 2018 13:22:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdanPfEVVy4xtm37gbuYpq1kUaIgk+rUWyL6l1dx6RRIFhgl7f9+wfn2eEzyWQ9rOFNjpQdq X-Received: by 2002:a63:91c2:: with SMTP id l185-v6mr16264635pge.321.1535746921565; Fri, 31 Aug 2018 13:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535746921; cv=none; d=google.com; s=arc-20160816; b=c7B+dI1M57XdUxvm9Oetidc1wwFyrw1g6cNhp5XgqJmOvkKa+WeDXWaB5epwIcEEVn LCt7g5/dwdQDLIaBsxWVfoVEkMGlMpTUuc5Fx1NY70kO09TTz47iYkTEvYsPz84a+izL IXV0WH6ODE7P0qfB556CmXWl18MUn6IXTXn326r2WeIdwk9eLglqs+jMckf4v1X8HeIK 1GNsq/zbr/DkGRVzMT/aGgM4NFE8cvSvbbsvt1IMUv8i7Cuf84OkdNsdG18cXvZlOlGW T49ZIAh9duH55I0Ve+NSBRWx+hpuWlKrJta+n/OYoNCKeDd1KrPUVsel8VpG25kGM5Fr iUBA== 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:arc-authentication-results; bh=xB65XgsuIhVMr4wfu+fmV5tJ/QI8bJpBH5q/qwwB4aI=; b=oYmN6ysThYqgAuCO2YJypEvbCnqh+ELU7Tb6J0zxfmNDmtzoD3jdhP9M4KX3JEJ0cE VKQapUX43SnHaOSbu8My9Vfztq4yTjKd9kHDxzYOb5X+n0MF04rbJTB3DBWqdQezujng 56vmYCmnqtRYISZtXtYXQYC4BuiehjT4ot+MCRHTDTfHqtQv0gX9FHQDY+WQ+oU+I9Qd kQZmHmu7zEBgxqeh3t3ysg3MaumgOizJ/JZ0t8mSOo3JpGpr+obuPfrauI6QCK/iVI64 /5clpDrSwdN3MtJyPjk6nH3xmHhmGyEmjwVKXn/rJV9Y8qYP1lb37Puwaj4C6fCpuDur oshg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mLHZkhab; 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 d41-v6si10406361pla.172.2018.08.31.13.21.46; Fri, 31 Aug 2018 13:22:01 -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=mLHZkhab; 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 S1727551AbeIAA3s (ORCPT + 99 others); Fri, 31 Aug 2018 20:29:48 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:38332 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726869AbeIAA3s (ORCPT ); Fri, 31 Aug 2018 20:29:48 -0400 Received: by mail-yw1-f66.google.com with SMTP id n21-v6so5490440ywh.5; Fri, 31 Aug 2018 13:20:42 -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=xB65XgsuIhVMr4wfu+fmV5tJ/QI8bJpBH5q/qwwB4aI=; b=mLHZkhablFk9waUyMc8kuvj/PVXTKpZFF3mTAy+iVwTmSjp5bGMlkpbDQ+WexC9mat X7UE7Ks2ezPEFePe9khKWJkqkIsWGEcDRxIB7Wo/nz8VDcuVbv2YaiH4ZAOTeq47okVL dbT78Hp/pANTrGwrjY6jx2tHaBbyBtZOEUwQG38SKtuSruX3fqzCW6x9hpZfE8AdS1NA pEQ5i+x/Qv8YZKyd3EVN/PI/Ci9IqIhY2nx2lGmaGqrWEeDyTjMg2dUuYvbcp9ZK/VFx x7Rf0XUqTQvdOz8Tl/qkEdrAb2Ii45fyEpN9SGMjw3h+th+nnbIIXBiLTH6wQg+Zm5sF zazg== 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=xB65XgsuIhVMr4wfu+fmV5tJ/QI8bJpBH5q/qwwB4aI=; b=l9437i365aWGCb7BnbPNo95sD4ROqt81r1qxYoJZtvpiJEYSDWYD2MeI8i8XDE4KLu Bjie6qaZeMW7/QOSQMdM9Mwowc+eV8s8m40355wQjjQoM7iC65tMvipZ+/noFFnm1xum ChgEWBr5+34wbEr7oo8n0XO2iDnrX/y9LITnVvB36qh1zEyKlZ9T+py1u3flopUa5XMR E61Lsl2MZNETPr9EhG0bX8nbYvlnu5HovU/OtsOzfPxvgLDu3k3kNBrprzmmlKJpy/OK Ob5poo24LnaqYpvwhQzlkXxKGI78mFgAFthshh5b81oEMyVw7p5LYdWM5ouizndo8Oe/ WLzg== X-Gm-Message-State: APzg51CkQER6ceUnT0xTqQ14HZGnq/SVUGvKHC9a5ehAWcjlspB/ep+b A2UQhj8SWNIWwW7OkwX2fJUNCegdjO4= X-Received: by 2002:a81:2a0a:: with SMTP id q10-v6mr9970329ywq.159.1535746842438; Fri, 31 Aug 2018 13:20:42 -0700 (PDT) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c091:200::3:ae4b]) by smtp.gmail.com with ESMTPSA id j8-v6sm4479117ywj.6.2018.08.31.13.20.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 13:20:42 -0700 (PDT) Date: Fri, 31 Aug 2018 16:20:40 -0400 From: Dennis Zhou To: Josef Bacik Cc: Jens Axboe , Tejun Heo , Johannes Weiner , kernel-team@fb.com, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Jiufei Xue , Joseph Qi Subject: Re: [PATCH 03/15] blkcg: use tryget logic when associating a blkg with a bio Message-ID: <20180831202040.GB20194@dennisz-mbp.dhcp.thefacebook.com> References: <20180831015356.69796-1-dennisszhou@gmail.com> <20180831015356.69796-4-dennisszhou@gmail.com> <20180831153007.nybnuyx43adn76rm@destiny> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180831153007.nybnuyx43adn76rm@destiny> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Josef, On Fri, Aug 31, 2018 at 11:30:08AM -0400, Josef Bacik wrote: > On Thu, Aug 30, 2018 at 09:53:44PM -0400, Dennis Zhou wrote: > > diff --git a/block/blk-throttle.c b/block/blk-throttle.c > > index a3eede00d302..c626e1f7cdcd 100644 > > --- a/block/blk-throttle.c > > +++ b/block/blk-throttle.c > > @@ -2129,8 +2129,9 @@ static inline void throtl_update_latency_buckets(struct throtl_data *td) > > static void blk_throtl_assoc_bio(struct throtl_grp *tg, struct bio *bio) > > { > > #ifdef CONFIG_BLK_DEV_THROTTLING_LOW > > - if (bio->bi_css) > > - bio_associate_blkg(bio, tg_to_blkg(tg)); > > + /* fallback to root_blkg if we fail to get a blkg ref */ > > + if (bio->bi_css && bio_associate_blkg(bio, tg_to_blkg(tg))) > > + bio_associate_blkg(bio, bio->bi_disk->queue->root_blkg); > > Except if we've already assocated a blkg this is just extra, can we do > > if (bio->bi_css && (bio_associate_blkg(bio, tg_to_blkg(tg)) == -ENODEV)) > > to make it clear that we're only attaching it to the root if we failed to attach > a blkg at all? Thanks, Done in v2. Thanks, Dennis