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 EDFCBC3DA4A for ; Thu, 1 Aug 2024 21:46:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C69F6B007B; Thu, 1 Aug 2024 17:46:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1770E6B0082; Thu, 1 Aug 2024 17:46:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03F046B0083; Thu, 1 Aug 2024 17:46:54 -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 DA8D86B007B for ; Thu, 1 Aug 2024 17:46:54 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 625011C3EB4 for ; Thu, 1 Aug 2024 21:46:54 +0000 (UTC) X-FDA: 82405011948.14.0F360D2 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by imf05.hostedemail.com (Postfix) with ESMTP id 9AE9A100003 for ; Thu, 1 Aug 2024 21:46:52 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=X0Uh8c4D; spf=pass (imf05.hostedemail.com: domain of kinseyho@google.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=kinseyho@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722548783; a=rsa-sha256; cv=none; b=RrgQ6Vb5H3IjilFosOrxgjbQKELKZigoWHecsyPXB1GyuZ1n/hos7JYCW3+w4BaY5mOjn6 9Y+4IUyfaogga5EtCj2XUG2/JcW9PzMG1RQL2JiIXW3zczaAAV80WCXjvip+39aJCgQx+c X5revwfmKGzE2GugIGSqNuIL/CRonR8= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=X0Uh8c4D; spf=pass (imf05.hostedemail.com: domain of kinseyho@google.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=kinseyho@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722548783; 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=2JhOdtWGFh+BjTnlGjTZNX/sc5H+jvni3W/4Y2+Lfb4=; b=ltjVe99entypCJkY8NA6yrYreKT55owGJn3OV3XG8Hdc5krxpq5+Ugdo4fM/kRcSk2cBtM wDPMLNxPoEgcmYJdQtKwFXcMQtUYYwa6orra27pkfyq4zrB57tukyqyUdgmUzEz83TyqS4 90r/GtG7D6WJPbK97DQACHft2D5JSNw= Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-44fdc70e695so1116611cf.0 for ; Thu, 01 Aug 2024 14:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722548811; x=1723153611; darn=kvack.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2JhOdtWGFh+BjTnlGjTZNX/sc5H+jvni3W/4Y2+Lfb4=; b=X0Uh8c4DWQG5SlSMZqa3KXSHdDxSFf58dau6AAbBzXY/8NM9EFQHpclsP6huHTLNao Ee71M6LnSKS/Wb1oACslewL7WaHTMVVqVNtkUsntIB+uPFvjwPGjU2AXtWQJCivR/7Bg HhLjE924j8RiyXfiPyYfZD+xkx3s7JwhjxpYriAhTRUo2WqpIqIHcQaumcm5FilgO8je 0mp+DKu3PjCXpZ2Cec2FP5XAmyZ//vkmz4+G1dt7bfCi2fPHsy4STRc52ligD/jZcXqy urQccSKZc8oj1ya3v5SvSFp1iGtc5jQVxPbtxtKhE+m74jmN9D3t95d3ho+lG0LwloBD YgFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722548811; x=1723153611; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2JhOdtWGFh+BjTnlGjTZNX/sc5H+jvni3W/4Y2+Lfb4=; b=q6OhMcH0VQhin+LnbVgfKw/DpAI/7V3BKnI0LedAa8Fvm2qijIVliqJrXDy322anQ1 CXVQGr64bW8Bxf/HhLRbyqgs1L8JHnaOTZSSUPey1jCa+O3lSsnq03j3s5YAZhMAcb7B nc0+yQDsKfA4LVhEK6V74FPI8kEcnU1Or5dW+2IS6ziFyEKNEBkyHOK6zoEp72prpiPA k4byUNDZJTi6WuYPlDQWr30Plb1WYB124Djq0I6wuzG1iJfz7xth1htgfWYpWGVLQCiX ehO9BK42SqwqwytFODz82+o4Hz3mN1M7YlRKdYS64tolWrox2kEd1DnqqFaZlTDywki3 F+xw== X-Forwarded-Encrypted: i=1; AJvYcCVSwAb3HVBDWyooV6dCCjcRC10Ph0OGPPge2V61S2qLHpes4Q9vArWsVd7G7cEPovF5oBIr4yBf/mvX36rml/xgCXw= X-Gm-Message-State: AOJu0YzgrkOn56r7HBjlZSX2LeQTiKCz2IIDfRX0bauKQwURr48GTKkf f6mvtzcx9QlzRRcNeZhwa8BvBXC//bgMav1D2gz2i2RRnrIHByK9X2fcboY1hq4ToOzJFSzB91c CDbJa7+8Z8lS7zC7sDhA/vq/0lRosMxQkaZI1 X-Google-Smtp-Source: AGHT+IFTyc7AKpgBdPFS75ljdDFTFcQX49wqMB42mDQM9VjpBq8BbVvZu1KJxmnx+k0MrWdiPLpw1Y0xv2lLQFC3AQE= X-Received: by 2002:ac8:588d:0:b0:447:d97f:9765 with SMTP id d75a77b69052e-4518c7228b8mr353201cf.16.1722548811411; Thu, 01 Aug 2024 14:46:51 -0700 (PDT) MIME-Version: 1.0 References: <20240724190214.1108049-1-kinseyho@google.com> <20240724190214.1108049-2-kinseyho@google.com> <20240725204346.GA1702603@cmpxchg.org> In-Reply-To: From: Kinsey Ho Date: Thu, 1 Aug 2024 14:46:40 -0700 Message-ID: Subject: Re: [PATCH mm-unstable v1 1/4] mm: don't hold css->refcnt during traversal To: Yosry Ahmed Cc: Johannes Weiner , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Roman Gushchin Content-Type: multipart/alternative; boundary="000000000000039ed5061ea62684" X-Stat-Signature: deoompooix5yii99eonr8es7zkheywce X-Rspamd-Queue-Id: 9AE9A100003 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722548812-575776 X-HE-Meta: U2FsdGVkX1/vPttilLXori58I7tZc5oPT3SVY/EM6jx+Di7DSE2jmpGlPJrnD+99iSVwJToOe9nLiAVKOnn2KvMmAkFDNzmnIpM5kExGs/d2i9dGVGiMCedf+tU2IqnnxiR0IvrXmw7kCwZg7yyXkLs8fwO0SNoVWHvtlhB+RQkSOoB4aFK0zcThm6FfT1GnFIJCahYTUQboWZc4OKoqL/3DJjoUrC3mq9W9GMZoxjdlgxb1glqGDm8TfQlYHiGojFQX39gjwRka5qLfbKKXAwlR8Zi/8v4ZPgnDWr0Eh4hJFlXRJ9R8lnNdPDpNkHvNFhaLzUzwBtMo+i2krqB3OhwciSRIEqz++jLcayG0TgN9OkKvptL6qmfh2whw1w0IVPh+KpqscxM1g9fcL4gCHDCbFrhceeV7riw4tK4UeHxu0wvUTjkWRuLR1FFhYKk3bV9Q6mzmOeGEzj7AJ7XvD7nA/zeZGp2KeT0NvdDqtk1qqlpZ55+WwDkUmF+TDwgctQexH/9AS4PiiXXB7vT/R387m1URU47BE3cz5DX/TwlFZbqjZe8YMWPUlJ5RGKAygjzhtHAxhmtKmDiOyOU8R3D2TkmiaEpey/BGGP/O/+EvHIAEU2ycaLaM2xJ5SYWZGJbv5FMGOlhjyBMu5wmNgBX3R/A9j+JXyWLz57UiYXFpHPvz6h7c7SRRN4okj8var50HYDEHZbZ4T0yBzRj8A6DOstx/o4CSyl+sS9+Al10uc7PNuKJzPSXWNg+fUgIG81TMUQOyD6j1iq+B8Jg3h3foBJh1reUUz+609aR4fxsQhRf+jj3jScfSeEqVqf2heFXpyaAFTUBsxd9QSZvMKCzsdRWOD6/i5ISczmcjLZqfJxDMtkAOuXcy7XWJPn8pa69le1QEHO/vTz7wOAbtXVFEkOTqbgJhBl/+0VZnWEvkJJ8sbbokFXPGwXTZix9MqgFL/5BkbV1hXaVe3yN Lu7dUmZx +gPQ65aw4N65/Ub6EPW6f49GQv2x/MeTPGb4KQf/Jp8qasO+jy/CEY0NIBTnjZ0nAmGSldyTkAkHvmyBvBPvDpWchWZuvm02/ndOmlruWbuO5yJBHEU7NpCfSoEEk8vgxjGX6sdJVsZhAortlC7y/WWezAQfLvmaPs7sB48os8VkufaD/izNqBiZ+sBK9a0IGVjneMLcnqMJHRl6GCaWv/BAEvwN9vEEUucNBXeGx66cx2D4kxPu1RblGUCb+h5l8ZNpQha7rFz7uAsemIcn7jWRyUzeO55vSmRam7d1SfpBQKtEWxB9VCYIKj8N5LUlg6Yuh2vE1Z4UftktsQGkZy1mbJsIPuf9td7bE X-Bogosity: Ham, tests=bogofilter, spamicity=0.002518, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: --000000000000039ed5061ea62684 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you Johannes, Roman, and Yosry for reviewing this patch! On Thu, Jul 25, 2024 at 3:34=E2=80=AFPM Yosry Ahmed = wrote: > On Thu, Jul 25, 2024 at 1:43=E2=80=AFPM 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=E2=80=99s 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=E2=80=99s 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. --000000000000039ed5061ea62684 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you Johannes, Roman, and Yosry for reviewing this pa= tch!

On Thu, Jul 25, 2024 at 3:34=E2=80=AFPM Yosry Ahmed= <yosryahmed@google.com>= wrote:
> On Thu, Jul 25, 2024 at 1:43=E2=80=AFPM Johannes Wei= ner <hannes@cmpxchg.org> wr= ote:
> > What does this buy us? The tryget is cheap.
>
&g= t; 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=E2=80=99s readability.
> This reads to me like it is intentional that RCU protection is en= ough
> for @pos and @root, and that the sibling linkage is RCU protec= ted 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=E2=80=99= 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 m= embers so that the safety of the css in this function is more clear to=C2= =A0users. If this is sufficient, I will make the change in a v2 patchset.

--000000000000039ed5061ea62684--