Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2081163imm; Fri, 7 Sep 2018 10:29:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdalVLILTdBGldeU1b4H/d9tHtqVT1N0zDx+YhifsjrO3y9ewwPugk0ipDkqEevYoHocR+cR X-Received: by 2002:a17:902:4201:: with SMTP id g1-v6mr9150057pld.203.1536341349654; Fri, 07 Sep 2018 10:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536341349; cv=none; d=google.com; s=arc-20160816; b=RG4l3cyOyCigv/2d09SLc/2Jva4M52QHq+Wwp1uwPc0c2J6YV5MJTLiUAZcf/Cx3YN 6HUqAaYIbOR7CLnePEm/P4Piyel+CD7P5NYcD6Pnefp4Q+uHUGl4ibWNCUyPE14PQiGt FuYuxZGEXTWo7BMJgWrI/4hYJj/NiWa5kqFc3q0wgtwzlB3bwPF6kHysq3pE32/p8+nX NxQQF2QegV/3tCk6XCymrBjwLrly/flPXstJ+Ja9LUur4yvn55KsdtJoXkZbedX7kCKL JQD9zp9Lu+lkRbUi7xKvaQA7xNo9pVvNb9TNOS2gmmLQqi3PD8d74RKyfiYn0pnUATW4 Nj4g== 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=iqig52G65T1oK5BZ8bJW4GpEe9IWDxjBJiK5Ly/PDlo=; b=EHkFvhDstpPXjNNidHiDZMfuHfZg6jE3531GUSX27G7UQYB6Nk+PBcYVL209Kr26Mp ErA8e7JQDw2JhVIKlfnPlk5OniebOaUWQ3h7kESW4nvJ/Am1bV/mob190ZB4qRhNqOQ5 wvlYq2DTWw9Qs1z9D5OgZPRPzA8u7Cl8f2yV9FJNljazLeCNjQEKehKfBk7bfINrx1ea B0DHWL+nurAzb4dGmt8bdElPM4Ujz2CZ/QNzH40qpok+Qrjp/A7AtQGGBqtuCH+B4JF7 lOLHU7mou8lhjNFnPRBuRTji3c9Yvo4+ABCufQHERzFZIQbHHlYkcfM0UCOvtBxASJEq lfww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=W3D3Ztpi; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9-v6si9055806pfj.338.2018.09.07.10.28.54; Fri, 07 Sep 2018 10:29:09 -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=fail header.i=@gmail.com header.s=20161025 header.b=W3D3Ztpi; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727579AbeIGWJa (ORCPT + 99 others); Fri, 7 Sep 2018 18:09:30 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:38223 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725963AbeIGWJa (ORCPT ); Fri, 7 Sep 2018 18:09:30 -0400 Received: by mail-yb1-f193.google.com with SMTP id e18-v6so5729664ybq.5; Fri, 07 Sep 2018 10:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iqig52G65T1oK5BZ8bJW4GpEe9IWDxjBJiK5Ly/PDlo=; b=W3D3ZtpiNJc27H1HB8ioZhJWEiXGPm9/5ONMzbWyxOaj21TqcWhqZpB84JWJsC+CgI gS/3Ht110XWa6B5moexvgg3Mp87rwMUaKfoeTcoIjyoHqTq4pyqg37k/6RsPLGi2geYF Op314hKbcmqwwAZtA0HQr8ym/TCLiYkVsncFTntIf5Go1ETM6sluyG92UfQZncXkmmPF p9F9aBqEUIVqrRK2Xr8SZSrb60XKVuvFwPBX9Zw6zs/R0I5FztandOqBJBpCGo9LMUqb 6k5TFSynVNhm4UG6lAs5I5UeXjdR2ZWz9o366CNAnHvdkhp2y1PIhacEmP0xL4T2qVg2 lw/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=iqig52G65T1oK5BZ8bJW4GpEe9IWDxjBJiK5Ly/PDlo=; b=b+O8CIB0h/xcpZ6yYyGrQYTyKzxoWX7xN5+1AqRLewD3iSSb6RwFjGdaDEyeija+w0 kR9oMMvRtkD9mtaeufXVKzHKW8Q3YG0B2fDQ89knXcoBJjvW3MOXWEX/g4kiXe4xRiot v59qp55e1nkWf2D1W2P4tNxpzhQRVk7CQ7Gdq4u79RksjRgsyMtUwRpLbg+cwylTJNHE VsyJJSAHk/6QRJ8pXacgo0vFbX4a3P80A81oiSQQM5YBbJbaxXpq5tUcnn6hUMP5a8Tn BkmObLM9R4zP5kXJmNC9Y1RgALT0vDm2CoxAlftfHdtCQvvne7XWr3FzigpvX60njeqH +VVw== X-Gm-Message-State: APzg51DKTjYi14IxdZNWiRnnNA1WNUellLPTYa7qIG8O1BIJSK2UOlX0 M4mGDbiMgf6cKgoGQymD3fk= X-Received: by 2002:a25:a2c9:: with SMTP id c9-v6mr4491657ybn.27.1536341253270; Fri, 07 Sep 2018 10:27:33 -0700 (PDT) Received: from localhost ([2620:10d:c091:180::1:70a9]) by smtp.gmail.com with ESMTPSA id t124-v6sm5539292ywt.105.2018.09.07.10.27.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 10:27:32 -0700 (PDT) Date: Fri, 7 Sep 2018 10:27:30 -0700 From: Tejun Heo To: Dennis Zhou 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 03/12] blkcg: convert blkg_lookup_create to find closest blkg Message-ID: <20180907172730.GB1100574@devbig004.ftw2.facebook.com> References: <20180906211045.29055-1-dennisszhou@gmail.com> <20180906211045.29055-4-dennisszhou@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180906211045.29055-4-dennisszhou@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Sep 06, 2018 at 05:10:36PM -0400, Dennis Zhou wrote: > @@ -2021,9 +2021,7 @@ int bio_associate_blkg(struct bio *bio, struct blkcg_gq *blkg) > { > if (unlikely(bio->bi_blkg)) > return -EBUSY; > + bio->bi_blkg = blkg_try_get_closest(blkg); > return 0; It prolly would be a good idea to point out that the associated blkg might not be the same one passed in. Maybe this gets cleared up later in the series? > @@ -298,14 +297,23 @@ struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg, > while (true) { > struct blkcg *pos = blkcg; > struct blkcg *parent = blkcg_parent(blkcg); > - > - while (parent && !__blkg_lookup(parent, q, false)) { > + struct blkcg_gq *ret_blkg = NULL; > + > + while (parent) { > + blkg = __blkg_lookup(parent, q, false); > + if (blkg) { > + /* remember closest blkg */ > + ret_blkg = blkg; > + break; > + } > pos = parent; > parent = blkcg_parent(parent); > } > > blkg = blkg_create(pos, q, NULL); > - if (pos == blkcg || IS_ERR(blkg)) > + if (IS_ERR(blkg)) > + return ret_blkg ?: q->root_blkg; Why not ret_blkg here? Thanks. -- tejun