Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3263919rwb; Mon, 15 Aug 2022 22:40:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7FYmXRLoQd8Qe+3TFuNTlSA/Ekzp83PDd53rL8rGph92w+B0JFAYE40yZqkJwFOPz8mKz3 X-Received: by 2002:a17:906:93ef:b0:730:69e0:dd0c with SMTP id yl15-20020a17090693ef00b0073069e0dd0cmr11821016ejb.609.1660628447515; Mon, 15 Aug 2022 22:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628447; cv=none; d=google.com; s=arc-20160816; b=mWnQ+XR9ivIqFSdSoDBnC9cIRHTxmLLSqoONZEKec+gdFG6ccQqFbW+IV/Mww9DUWy LX0Lq8teNzlxNVHrme/FdvEsbCpO97Aiv1B3WFLfGAQ1mb9Rm8lbcZfv1fIrGXefGi9A Ed7itBeox1KfkyQzXR20GMei0unf3qPd6VZ/zHhVHdqOHBL56j6Td/OMg8L+CZx4lQuC wA78tBBoygY0vmEHyKVUGbjzdvGQwbvfzIkSVHqrj/I9GOGCgv6N3X8cxBNxIjWWwiXd rVZBvVUIumqfGl3/3qrcUOlbp8e1ow0dFeBZYyuVHzruoyAL9C/e5y07yiSEk8aLoTsM ygug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=gWg73cYfI3vn4ljKPn4NYzrF9DqHWCnArM+29mdyT+I=; b=qsOmT5DERqIMHNOowSgy7A1Wyk2ffc/vayqeqrr/q8WotnkrOnsvzXaNmNg80tIcjP V2e/khHFyg6Em0XiV80HrllRts2wIpjk+8J1Rgl+491I4RbhqZGn2vyNiuNYhfr34Tmz L/qGxBhzABCFCTm3a2UT++Q34aD9yMn59oHLeJ+s1hs5ejD6qKwqJDngO4Imbag1hnT2 /rCymUBRIRbXwlt1HLjQHjc9a8n0u1PcUNZFpq3kZtLNEjqOJusuSUAHf1p1ftA2E/9w /E/cpwBZM9hBmsAyDF3JmCHz4RL6RMZIUXN3jPYWJCaHhmQwSLO9bsfHWVqCKNsIhsJu ybFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JdnWdzKS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a50fd0a000000b0043dafb921f0si7492828eds.617.2022.08.15.22.40.22; Mon, 15 Aug 2022 22:40:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JdnWdzKS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232182AbiHPFKq (ORCPT + 99 others); Tue, 16 Aug 2022 01:10:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233223AbiHPFK3 (ORCPT ); Tue, 16 Aug 2022 01:10:29 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C66D23D; Mon, 15 Aug 2022 14:17:19 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so7828843pjf.5; Mon, 15 Aug 2022 14:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc; bh=gWg73cYfI3vn4ljKPn4NYzrF9DqHWCnArM+29mdyT+I=; b=JdnWdzKSg3O1vPGcLmn7GlIHnJU/Z/J6io8Fo9ke8TmxNBQVwOYCBoi66M69jVhNAb +9wgMaaslDSuSEQUV5pfj52eY1qRUbZ/LS4Z9UwUHPjivwimi+teLl0IixZ77o7nKeaO dUnInH76iDFaiADer3fl19//dgpQ7cSvpFJAb2rPPVX7xS1S87WXZay9b3LRUOHqOar+ xRF7l3DTI4EgW15ppokevTzJQTlke5q3Zm35MpdrMsOJq45vXPM3U8eswj6d7vgLeMhu uRJ5C4SKERyaTiDg7tN3KphglynvwlIZSAlXnAkUo/K1Zk5SR8+9WqhJVymF9vEN/TCN hAXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc; bh=gWg73cYfI3vn4ljKPn4NYzrF9DqHWCnArM+29mdyT+I=; b=SVpTQPwQw5H6WappGElqMErDR9XYq8yqJQwpUx3j9/ymvqPTLe9QsO3xepERZ6dLe4 Bf6oaf+Xo19vbM0DTjhVmWNc9TpMa8VWLn5KaXhHB0WZzrt2kOBuhJ9UQPl3S7M6nmH/ 1NJfSVcnueAYOOoSZ578s4u3AOOuQWIRBkyjyuyEYHA7pfU3I10wtxjyVG1+58IbQFFM zRBUdIEUFsTCrtFpRQsadDLb/4hWjFeA3WcrQLFgrXDzZvmHU5bOLmgGrrhJYjHGLaBs K1sDK/MdnTMsKkdLj88lW8W0IWlD8mVQi+JS2V/jz98Bu1FHHxbvz4l9GJ8e5sIoSjVA MH0A== X-Gm-Message-State: ACgBeo2I0TfpXk3bmyw3qy1tFCm1MJw3ZLwbM2ItKJ0rBzAAacLliihV YF73idRaVyZPruo9dvKj1JHCZq9/kf0= X-Received: by 2002:a17:902:c405:b0:170:88b3:c108 with SMTP id k5-20020a170902c40500b0017088b3c108mr19034977plk.172.1660598238617; Mon, 15 Aug 2022 14:17:18 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:3a69]) by smtp.gmail.com with ESMTPSA id f7-20020a623807000000b0052acb753b8bsm6901114pfa.158.2022.08.15.14.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:17:18 -0700 (PDT) Sender: Tejun Heo Date: Mon, 15 Aug 2022 11:17:16 -1000 From: Tejun Heo To: cgroups@vger.kernel.org, Zefan Li , Michal =?iso-8859-1?Q?Koutn=FD?= , Christian Brauner Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, Namhyung Kim , Pablo Neira Ayuso Subject: Re: [PATCH v3 cgroup/for-5.20] cgroup: Replace cgroup->ancestor_ids[] with ->ancestors[] Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 29, 2022 at 01:10:16PM -1000, Tejun Heo wrote: > Every cgroup knows all its ancestors through its ->ancestor_ids[]. There's > no advantage to remembering the IDs instead of the pointers directly and > this makes the array useless for finding an actual ancestor cgroup forcing > cgroup_ancestor() to iteratively walk up the hierarchy instead. Let's > replace cgroup->ancestor_ids[] with ->ancestors[] and remove the walking-up > from cgroup_ancestor(). > > While at it, improve comments around cgroup_root->cgrp_ancestor_storage. > > This patch shouldn't cause user-visible behavior differences. > > v2: Update cgroup_ancestor() to use ->ancestors[]. > > v3: cgroup_root->cgrp_ancestor_storage's type is updated to match > cgroup->ancestors[]. Better comments. > > Signed-off-by: Tejun Heo > Acked-by: Namhyung Kim Applied to cgroup/for-6.1. -- tejun