Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2625501imu; Thu, 29 Nov 2018 07:50:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/V8YzKCR5wgsQeKufyLo3424zNee1nBtZeqJVX6esjf7lIlizuKUJ2rEOmntJZVum7ok2lq X-Received: by 2002:a17:902:6948:: with SMTP id k8mr1955765plt.2.1543506640345; Thu, 29 Nov 2018 07:50:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543506640; cv=none; d=google.com; s=arc-20160816; b=zh0y84ZrdKKG6wOGhhdSGU37Gaa3cRaGQBUOLbIaF8Qe0y7BEQymWHqt847WoqTHbx D8UljLqlNYYhct4aQmID52G3xCfaa26Sg2RB7/hutxG1w6TqstExFjoyIQnhYl+lA/SM h+Ql4yKI5tbo3PhLCrDl2CbPif7Ui4AG8/IIOwGrFWnq8UK61vzoSnY6V4m4UilY3BA2 w1BOLh7Dug9pt5Oz43T1096INufUOGfGiQjFkuiNwPUrs92GFaajQ/xILTLYG0H8rAlL cdjOoCo8enCO1JgugbuhFSsrp1CKij1bFiltbqV1zNh7jwoT5xEamt8nwFI0PmZ9iz6e N7UA== 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=kz3dlz6bQKYwlGklFZS+mfDThvjV457sQrSsgWVJFng=; b=VgE0xbB3hwwQ3iqdZkm+55ZZWDM2NotCU+YbDnvCrOqVh0eiage/4B2hIKqYZDN+im t8vnSL1t1mjkk9A6xH4mKH/hnQbubf6l9YRCxoLOotdJ3jXnwjQyNjq/GhfiaYi7hog5 qexDjYW05E60En3JTVm5R25YXSYXm1sdlLGoN5pboV356YVXTAHpUvcZrbQPA/nEOWmF t1sPtRMyARFKTHFGuNlqOQNvyl3zeXmr/ecrdz6+mR/nGCFtSHz6TGI2ZIxL/4m5P4Wi 2MN6wjFwdLRYjtaGs5fEYmI+l7nDJh0IG1BZt6W5Cfwu6HEK8Reyvey+kSfN402+Ss5B lzEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="vN0j/r2R"; 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 w11si2336681pgf.452.2018.11.29.07.50.19; Thu, 29 Nov 2018 07:50:40 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b="vN0j/r2R"; 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 S1728872AbeK3CzL (ORCPT + 99 others); Thu, 29 Nov 2018 21:55:11 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:35898 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728423AbeK3CzL (ORCPT ); Thu, 29 Nov 2018 21:55:11 -0500 Received: by mail-yb1-f193.google.com with SMTP id g192-v6so925094ybf.3; Thu, 29 Nov 2018 07:49:23 -0800 (PST) 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=kz3dlz6bQKYwlGklFZS+mfDThvjV457sQrSsgWVJFng=; b=vN0j/r2RslOzzzUxYdvwqlYZlvRszVNX/btGSlpATxyvpI2/Y1pAMV2uPkrqvMXoRX nHvwy8NXinkgfGCnhQ/YrbWcp6fTQgua/fKOSIOV4Zbfc2ZXokJLb9KVvud3NSHxIQBa G0mIw1neHBa0XvVR5ROuv38YIPOMuumXHjVlZOTntH6BsRCtGBY+sm/YNwgMpBlKxKvi 1ywaWVeJdQjR4soDpb/sifDolAYXlLTKJY6E5ENC+gBsrDp+TMuTAviQiuqO1xd8cYnR kvOq7NIdbQwSudVxpf42O1AHmetw5cm07OE9afOESCLEzlpskjuXg+EyVIo+HoGxleZ+ 43Cg== 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=kz3dlz6bQKYwlGklFZS+mfDThvjV457sQrSsgWVJFng=; b=K2szJ+VQS+vcK4ObnrTDRc0ZJoPmBhTvWVU+DYWeLf6qAQgDW2YhPwRWD64tfP/Dkx 6tv5Ic1jsz/wtMVSaNVyt/CBte9OtOyUT1SLOZ2XgWp4uJUQqh0RhRjj6hQatxZQcJOI UPwV0DMeHvt/EfWzh9eCF5YZcxwBS5O57MZfBYdf5pSHnUDeubHcS4AwA6DlvTtslxOE thsd7TFGP+U+BIG8aNOK9NGO+uwGJMgr69KNVj7148m/XCRcGWDAEt+o03WYwFYAGALs nqFIW+ua9VaXWM54gY693hPwms3wUEiTDPv3WGf1VpCZjskJPa7e/Bvt0eJjKsoKmY/L V1Ug== X-Gm-Message-State: AA+aEWYzBfZFk70hue0OPnlD0i2jNao1ZrW+cTOTfqldYfeWf+hUsO11 H7NASmgpCSEjBEtUBb/M0mqB8X/M X-Received: by 2002:a5b:eca:: with SMTP id a10-v6mr1734183ybs.242.1543506562214; Thu, 29 Nov 2018 07:49:22 -0800 (PST) Received: from localhost ([2620:10d:c091:200::7:c5f4]) by smtp.gmail.com with ESMTPSA id p203-v6sm789514ywb.34.2018.11.29.07.49.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 07:49:21 -0800 (PST) Date: Thu, 29 Nov 2018 07:49:17 -0800 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 04/13] blkcg: introduce common blkg association logic Message-ID: <20181129154917.GD2509588@devbig004.ftw2.facebook.com> References: <20181126211946.77067-1-dennis@kernel.org> <20181126211946.77067-5-dennis@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181126211946.77067-5-dennis@kernel.org> 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 On Mon, Nov 26, 2018 at 04:19:37PM -0500, Dennis Zhou wrote: > There are 3 ways blkg association can happen: association with the > current css, with the page css (swap), or from the wbc css (writeback). > > This patch handles how association is done for the first case where we > are associating bsaed on the current css. If there is already a blkg > associated, the css will be reused and association will be redone as the > request_queue may have changed. > > Signed-off-by: Dennis Zhou Acked-by: Tejun Heo A minor nit below. > +/** > + * bio_associate_blkg - associate a bio with a blkg from q > + * @bio: target bio > + * > + * Associate @bio with the blkg found from the bio's css and request_queue. > + * If one is not found, bio_lookup_blkg() creates the blkg. If a blkg is > + * already associated, the css is reused and association redone as the > + * request_queue may have changed. > + */ > +void bio_associate_blkg(struct bio *bio) > +{ > + struct request_queue *q; > + struct blkcg *blkcg; > + struct blkcg_gq *blkg; > + > + if (!bio_has_queue(bio)) > + return; So, this isn't actually necessary cuz we don't stack with request_queues but it might be more consistent to call disassociate before returning above so that even if sth like that happens the function always guarantees that the blkg and bio agree. Thanks. -- tejun