From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9C01C3DA64 for ; Fri, 2 Aug 2024 01:28:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4BA056B007B; Thu, 1 Aug 2024 21:28:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 46B6A6B0083; Thu, 1 Aug 2024 21:28:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 334AD6B0085; Thu, 1 Aug 2024 21:28:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 15A816B007B for ; Thu, 1 Aug 2024 21:28:47 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 918F01A072B for ; Fri, 2 Aug 2024 01:28:46 +0000 (UTC) X-FDA: 82405571052.01.F84AAE4 Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) by imf19.hostedemail.com (Postfix) with ESMTP id 6D1E91A0010 for ; Fri, 2 Aug 2024 01:28:44 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=GVbBM5xk; spf=pass (imf19.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.217.42 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722562095; a=rsa-sha256; cv=none; b=8b+3QzITCjuMD5EoiBlvmUBaKZ0gdiFLKnxp8jM81I1KiNcoekipLJiPWiHS7eHy3M/xw4 oGzeekGL+9yyRLy2AAk9Hm9VF8mzxpE95UMHXi1coDXklH0XuDHxmytaf6S62MBenjRE6M DPK09KePxDQ5qcTLaoyoI5UQs2gqhko= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=GVbBM5xk; spf=pass (imf19.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.217.42 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722562095; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zKUD5+q+2+FARY5NYum2l/0OwIlk6YQuFBZMg9eGiu4=; b=2ujor8VqlTWaRZs8QtXHmALt42PeXGIRdxyAWjbiGGRr2q4XtgiKQDuqbe7HrVvGbFEB4o Jo2gvC4zLumXM2uUHBGhwhRnVdauOsyr3ti7m3EFE2+rt2JolaEqut4oiQvraabYEuoP8O 0MTxTUdoBiQJWC4LVCIcTD8+7Kirdsg= Received: by mail-vs1-f42.google.com with SMTP id ada2fe7eead31-492ad3fc768so1462461137.1 for ; Thu, 01 Aug 2024 18:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1722562123; x=1723166923; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=zKUD5+q+2+FARY5NYum2l/0OwIlk6YQuFBZMg9eGiu4=; b=GVbBM5xkPXLs80yfFqbBkg2ce17rcuQNRavF7nSSCCy4qgz3mJJTOPcZ4LhGipB64j 6ZgZgYLpA2jCamlnMLn3+eYJurbNi/Qpv4d2Y2VlAmSm2DkPTqXfG9wfliw7J/G+psib g/zZy1nCInZYsS0t91qIEYWB+X2hU17h7e3kjA9CI2X3nCZ5vKanzW0lygT3dy+9uTVs wKfItpQVIhaxLzW7hDL6vvUn3nfOO61s2B8RjNe4Qyd6n73wAp4pixs8mBYzOL06eSfs pd61ZpQ6OPjUEuLEWjyB1U/EGdpA3oL/CpbTPYRsNJxObaVfmr6o1GrUh/mD5sDr3RVW ECWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722562123; x=1723166923; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zKUD5+q+2+FARY5NYum2l/0OwIlk6YQuFBZMg9eGiu4=; b=ZK3YPrwmI2T4VD+U1x852hj955GEc2dAdhdGdZpcN6A2qiWR4Ejeddm+tyUJoCXa4d 1bHnn6IYe5uz2WA4aLlnN3RK7tGhjW/+aLYLuj8KHBMShDuAxHNmTuIMuERZeYrWeU7U bz1oivv+ntmfxK+oZZi1ZD5/FXURtCo9DNHBw6N7yDtzNBTiZKm4w8kCb+S5lMVu4tbR AlJw3PbKptADCp63biShBD6Bo0Xc2JFlSMS22OOtfT8WtFUeclGmhNeR3jzNnt/9QRzj tLSTDSrLp+9nj+uIKhJX4TouLZG/oeFEbZpRZ5rdiCVEAb2Ybo0Q26HxDWHLabbIKJeC a6Aw== X-Forwarded-Encrypted: i=1; AJvYcCVyeKqTymajfQZEkKdB+Vz2LpZn+cYsj6LyK5j8o7kpbLApGKBIjmdj7IpKqkc6qwu0B3kA6grXg1gt+00htSynQXs= X-Gm-Message-State: AOJu0Ywi9oFrzx5n/3BH5Xm/lbfGBYpSlMy9hlNOhHvUE74rMNUzKs46 EkWhmNNkwdOjauMd2i0XXvsBm62bV/qg69h4HLWZF6gkACRqlGUwHd1W6JpfRyY= X-Google-Smtp-Source: AGHT+IHwZfbMP8zKT5avi5rhEpW2YzlUhsbuUVw/Pb3WCaRXvwCLhk8Ri4safqA3JO2OlfsoG0BJRg== X-Received: by 2002:a05:6102:38d0:b0:493:c348:4d9f with SMTP id ada2fe7eead31-4945bec3f06mr2464809137.19.1722562123383; Thu, 01 Aug 2024 18:28:43 -0700 (PDT) Received: from localhost ([2603:7000:c01:2716:da5e:d3ff:fee7:26e7]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bb9c79b1fdsm2237486d6.53.2024.08.01.18.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 18:28:42 -0700 (PDT) Date: Thu, 1 Aug 2024 21:28:41 -0400 From: Johannes Weiner To: Kinsey Ho Cc: Yosry Ahmed , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Roman Gushchin Subject: Re: [PATCH mm-unstable v1 1/4] mm: don't hold css->refcnt during traversal Message-ID: <20240802012841.GH3365290@cmpxchg.org> References: <20240724190214.1108049-1-kinseyho@google.com> <20240724190214.1108049-2-kinseyho@google.com> <20240725204346.GA1702603@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: dpeo94jo73skkqrbzexf194k95pbbcyk X-Rspamd-Queue-Id: 6D1E91A0010 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722562124-176576 X-HE-Meta: U2FsdGVkX1+5ZAbYFmOymPmiub8tcHPVzO3vZtgHU1SBWnt6npFQWiTusRxQy+GnK6ec3P8Ep7mETKKPfKYylVxYuqjLjLQLn39UxY1ypASQdPOyy+uYNlkEAc21VvenjiepXReJK6BhjkGXXdFiZ8uBpAEDxtaKafc/ZNyKa0JN4EVbx2wp+OGbVD+sPmzLssh4JM2QvyRfrwCqS8hParahOiW13gsUXDA+JnhL1aah49SYrWcQ4twHhLlWhg250KUUkC4WBmUBcavPLuF+1S0XOgYyhUtwzjq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6MlPCkUAWCVubGGeZH32Kc5UwrdiyuapNCUMVfBpDKBHmntGPHBdpUI56l8TEAxDdB9g473fTvdINkpfwfXRuM7W6rLsHrpfodtLQFw3 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000071, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Aug 01, 2024 at 03:32:53PM -0700, Kinsey Ho wrote: > Sorry, I replied to this email earlier but it had some issues with plain > text. Please ignore the first reply of mine (the one with HTML). I'm resending > the email below. > > Thank you Johannes, Roman, and Yosry for reviewing this patch! > > On Thu, Jul 25, 2024 at 3:34 PM Yosry Ahmed wrote: > > On Thu, Jul 25, 2024 at 1:43 PM Johannes Weiner wrote: > > > What does this buy us? The tryget is cheap. > > > > mem_cgroup_iter() is not an easy function to follow, so I personally > > appreciate the simplicity gains tbh. > > Yes, the main intention here was to simplify the code's readability. > > > This reads to me like it is intentional that RCU protection is enough > > for @pos and @root, and that the sibling linkage is RCU protected by > > design. Perhaps we could clarify this further (whether at > > css_next_descendant_pre(), or above the definition of the linkage > > members). > > Do we want to move forward with Yosry's suggestion to clarify that the > sibling linkage is RCU-protected by design? Perhaps this clarification > can be made in the definition of the linkage members so that the > safety of the css in this function is more clear to users. If this is > sufficient, I will make the change in a v2 patchset. Yes, that sounds like a good way forward to me.