Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7545759imu; Mon, 3 Dec 2018 14:53:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/UpLcOYaQzrmw8kMbdAr/njpTwjvTejxLq0LCQHugJop0vIkktkKBd3latlgFcViY4eMZmp X-Received: by 2002:a63:160d:: with SMTP id w13mr15177719pgl.43.1543877597939; Mon, 03 Dec 2018 14:53:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543877597; cv=none; d=google.com; s=arc-20160816; b=W1t93fAq16zI7uaERwhtJjg0Dma+ohK5weHQ7aORFi701KupJfnEkPZbPc0DOAia/v K2KTBDlBc9WUhWXvRD+O2IUxbYQ4cGagYTmBR3R7Cmb3XiwGyiqswX3jjOIPMVKt5TCn US7WB5rGw/cAelfDxNAUX9CwNmJmfffaRJji46pEMrT4f8+1AQIp9XNdI655k1F7RIZ1 c9/+gkELw0L+3DMtbdR1Qn6SbkLJomeMaa3r7bQQGUAiedcOUcQTKk/lt6h5jGbwUNQw dGRU3hczBCno1HW8Gs6yi5gmKDRfnJI2nF6Y+YcgalxFhIGfSWWTQbXfx+fccJSaa6uO CKyw== 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; bh=qlsB2qxyDXoJ5/gKi66gGtq+F1sMq5v1Kd3Slw2sXdQ=; b=ON+oRuKg3bRTGoflWf3KiW9uOfbc9gT6KOISpInT4KMrR4aJ/wCfAIL36ByXQ879PF j8MthmBgYfisWQGOmFMA16CTpcOW8Yv2w2AutJUXOb4lAT01+WW8IoBuT2pqnVvMAZC4 j1tfY6F/nSsKJG1YjIpCudT89RfILrNqLKpddrmK9IYZ6WXdW86gUVpgLiuPaF6hb+oe Gocn+G0lvs97JAInYM5EtEq426QBicEB/7l0yEhLjnyAok7lc2x595b523dJXOFcpHPM hO2MBNPVsJzbZEngoW4spYSdx/bSQU8dM0Q3CZUiyyOf0JfVmRr7/ZvcIJB8zFBh6V/6 q3mw== ARC-Authentication-Results: i=1; mx.google.com; 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 w8si13955000pgm.467.2018.12.03.14.53.02; Mon, 03 Dec 2018 14:53:17 -0800 (PST) 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; 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 S1725961AbeLCWw1 (ORCPT + 99 others); Mon, 3 Dec 2018 17:52:27 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:37306 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbeLCWw0 (ORCPT ); Mon, 3 Dec 2018 17:52:26 -0500 Received: by mail-yw1-f68.google.com with SMTP id h193so6141919ywc.4; Mon, 03 Dec 2018 14:52:26 -0800 (PST) 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=qlsB2qxyDXoJ5/gKi66gGtq+F1sMq5v1Kd3Slw2sXdQ=; b=DrSgxjU+UXNHPRpWBMltuCpFSuTxFP9D1G13cMWIXmGzhMyDiw8LsuBbDCs5yUln3d d1xFves/r6aXIB/9M1aztxwjGF4CTmEaJ3UxzSlPymFspejMYkoJ58FfUgvQ/pQtVHiy WnoXYzPHYd5n9hbvgIjfxvvJqFq+ajG0zk7TsR+PX0aV2BT+Yl81J90tcD1+fe5ceyh/ MzZ8CiORT/PQsjQmE7OKAVOHSXUMGFvvI0bCt+9CaCsaOpNVpL1xt1ty189VKY2RhUJx yrUurcefp2PmNultMEZGBruKwOXROrB7w5STxBa1/2YPwzwNab6Xr0nHvUML0NB0ewY+ bvWQ== X-Gm-Message-State: AA+aEWYYp/n8/6tnB2hj1KWRE7WuNrbLfzy11OPsMgP7M5k0tusHjJDu LVXJewLK1vEDDggGm9V9hQ8= X-Received: by 2002:a81:3184:: with SMTP id x126mr17920910ywx.448.1543877545496; Mon, 03 Dec 2018 14:52:25 -0800 (PST) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c091:200::7:e729]) by smtp.gmail.com with ESMTPSA id p3sm4763471ywc.14.2018.12.03.14.52.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Dec 2018 14:52:24 -0800 (PST) Date: Mon, 3 Dec 2018 17:52:22 -0500 From: Dennis Zhou To: Christoph Hellwig Cc: Dennis Zhou , Jens Axboe , Tejun Heo , 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 05/13] blkcg: associate blkg when associating a device Message-ID: <20181203225222.GA3801@dennisz-mbp.dhcp.thefacebook.com> References: <20181126211946.77067-1-dennis@kernel.org> <20181126211946.77067-6-dennis@kernel.org> <20181130095426.GB17103@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181130095426.GB17103@infradead.org> 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, Nov 30, 2018 at 01:54:26AM -0800, Christoph Hellwig wrote: > > diff --git a/include/linux/bio.h b/include/linux/bio.h > > index 62715a5a4f32..8bc9d9b29fd3 100644 > > --- a/include/linux/bio.h > > +++ b/include/linux/bio.h > > @@ -486,6 +486,12 @@ extern unsigned int bvec_nr_vecs(unsigned short idx); > > extern const char *bio_devname(struct bio *bio, char *buffer); > > > > #define bio_set_dev(bio, bdev) \ > > +do { \ > > + bio_set_dev_only(bio, bdev); \ > > + bio_associate_blkg(bio); \ > > +} while (0) > > + > > +#define bio_set_dev_only(bio, bdev) \ > > This lacks any explanation on when you would use bio_set_dev_only or > bio_set_dev. Please document why we need both and why you'd choose or > the other. I realized after thinking about this more and checking more use cases that it isn't as simple as swapping macro uses because many of the callers share common bio allocation paths. I think the simplest way forward is to have writeback and swap do reassociation and split out bio init code in a future series. So in v5, there is only bio_set_dev(). Thanks, Dennis