Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp64928imm; Fri, 31 Aug 2018 17:27:52 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda6wVoqrTdAWemXK/5QfXqKfwuD6RDBOFM0Sjfd6jKZsYvJ5DpOTEB0J2O6u8emKQ0w/hOI X-Received: by 2002:a63:f849:: with SMTP id v9-v6mr16675199pgj.71.1535761672212; Fri, 31 Aug 2018 17:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535761672; cv=none; d=google.com; s=arc-20160816; b=q4WZWLVT9c/Vp96eAm+qZhp7a99f41ulncVWGdPrGDLvzhn3zk461+/N6z0yJSfWZP U/MgkG4zAsm+ZXSQ6hItlbBurGxPJams0Tu2ASDqBgnnGw0Mrr0FL5kOr9VEBUcfXk4e wlUByjajXtqRwRyL1az5Vngs1Ig/tozCs6IB2rJqoGh/kqtW5FtvXgR5QCFzVIuH8I7R XYdYg2CCSyzrB/AKTi1e7Gpl+fXj7l0tZGvNnVfcjPx7pXb6Xt67WuEZ/Ifla8fIsAjz 5ksEFeceKjVEzUZr0j6PVK9iKco2mwTOKnn23p3reKr7QmL0tLn4+kcG21tDntz8Brbz DN+Q== 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=aYfyDUOdGSNfOZV/pI/zAY7JB35GXqB2P2f068rolNQ=; b=u3kK82bQUYR/i98zVAqRJsds0OPQbQljwTssR2OoE3SKAyImCl4Wi+6pWNR+btm7nm /l9CaaFgcUhYoRuuS62adAdK+RbhDKaMFN6QvLH3gWDHUKFc5dM4rSR1rBGmj58t5acT KRltE2a+BvEaDj5oCsLpevGKPdgqnZCULU5aNNTS7UR+/E0nL/eQxo/lK8+V/aVk+Y6Q IFjCzeAMvC4MFmW09jHxSl3ye6n6G4C2ZsVgVVwjq3d1pvPz/FTUuDTZ/r65rMVMvWHl muog73LybWPxLxTUqlwCZ3pYQDW7xz/aoZXC5o732kPpy0Gm4Us2Bwc3vgyTlqaLeGpP KbHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Z8Jenl1L; 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 s24-v6si11181332plq.358.2018.08.31.17.27.36; Fri, 31 Aug 2018 17:27:52 -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=Z8Jenl1L; 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 S1727552AbeIAEgD (ORCPT + 99 others); Sat, 1 Sep 2018 00:36:03 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36925 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbeIAEgD (ORCPT ); Sat, 1 Sep 2018 00:36:03 -0400 Received: by mail-pg1-f194.google.com with SMTP id 2-v6so5604368pgo.4; Fri, 31 Aug 2018 17:26:07 -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=aYfyDUOdGSNfOZV/pI/zAY7JB35GXqB2P2f068rolNQ=; b=Z8Jenl1LUYwyuWK1agPe3HE9kQsGp3l0rCQChLVbp17znEagSbfFwtK3d0oAEsgD9A rOsYi/XgduU9ayspmwBgZgCkhg/XXd+rEtWSGjr7ASZo2UclSnVzYHbSY5YS9q/5WNYv tdGjRN2Y9BqxZaf48tshmFB8yvpnGZe1LrJdxhTtet3IlDVwFazbg7A80v9Tmd7SSfRU ftAglG8VG+TAK+Xd7Ru3zKbWwByME7+fEYdDcRC+KUJeFcPLeTshxkbw5ASG1ADzyul4 0fCxkbCXUwrQQj57Hk3D0Q5TY/Ujp+iwMxgL9Ykti4U8Q7Cbvhnx+QR7FswC+P8Dv7/O edsg== 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=aYfyDUOdGSNfOZV/pI/zAY7JB35GXqB2P2f068rolNQ=; b=ES1StDEh47NfKGewHF+M/OqcnpI01/RkkxY5UaKvrSCjhxvbN1Pp+/5B/vqtCao6aR zhq0a3D0FoxyneRZmdpB4CF2TrzEV7WX27i1rCeu3qMPXi/JdRplIBVTG91sBdBx6qxe IrIKAVOPBWMdgXSoF3ihXo6Am3eXoWXDKqz72ZD9a42fGNZBjBGPXvL8FWTvp2XGaDSJ O+Tp737ClOtYmw+zmylkdZTi/UFmvKBhc2/L3VUlWtwdegNp1J9VZeMzII9tPoD+m+D8 fioetITXk/VHCacQTxoAZszf75Z3pegUluhfaBgGBJvKdxV6/xAvSzi9y71JmrGeTpDq He4w== X-Gm-Message-State: APzg51Cx0k6r30NpCosCpa7yAaOvorUcwo7+WfFdNon5anBpGHw4bZrY 6tOJZrQMsWGXjpBkPqikfkgaKNRKmzs= X-Received: by 2002:a63:1d3:: with SMTP id 202-v6mr16598671pgb.136.1535761566642; Fri, 31 Aug 2018 17:26:06 -0700 (PDT) Received: from localhost ([2620:10d:c090:180::1:a245]) by smtp.gmail.com with ESMTPSA id e8-v6sm17548808pgi.24.2018.08.31.17.26.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 17:26:05 -0700 (PDT) Date: Fri, 31 Aug 2018 17:26:03 -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 11/15] blkcg: remove additional reference to the css Message-ID: <20180901002603.GI1488037@devbig004.ftw2.facebook.com> References: <20180831015356.69796-1-dennisszhou@gmail.com> <20180831015356.69796-12-dennisszhou@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180831015356.69796-12-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, Aug 30, 2018 at 09:53:52PM -0400, Dennis Zhou wrote: > - css = cgroup_get_e_css(page->mem_cgroup->css.cgroup, &io_cgrp_subsys); > > - return __bio_associate_blkg_from_css(bio, css); > + rcu_read_lock(); > + > + while (true) { > + css = cgroup_e_css(page->mem_cgroup->css.cgroup, > + &io_cgrp_subsys); So, while they seem similar cgroup_e_css() and cgroup_get_e_css() behave very differently in terms of locking. cgroup_e_css() can only be used under cgroup_mutex because it is used during migration and has to test cgroup_ss_mask(). The right thing to do here would be renaming cgroup_e_css() to something else and add a new implementation which operates in the same way as cgroup_get_e_css(). BTW, this should have triggered lockdep warning. I'd strongly recommend testing with lockdep enabled. Other than that, looks good to me. Thanks. -- tejun