Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3261627lfo; Mon, 23 May 2022 00:14:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP0fbRrWFhssR8eWjhASHp+UbOQl0CJ+hK5sDUNq/mwil7Cx/5kdgmUdHcdOzYbWrqW+ml X-Received: by 2002:a17:903:41c1:b0:161:bec6:b308 with SMTP id u1-20020a17090341c100b00161bec6b308mr22042507ple.161.1653290088719; Mon, 23 May 2022 00:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653290088; cv=none; d=google.com; s=arc-20160816; b=QE0N1BztSkbXVGGAr7paw86v/TH0gZYmaUGP5YnApMvyBpS0nqKa1k7Cx44aXUihZt zpj2St+YYB4jcxZg5jfWdYloMfYYWxGyPdoYqnC/We8qXtSfW1lGJOPiQFYf7Es3tT2x CWjZ5n03TNss5a5NhjS9J2Cx63Dxzl+S2IfCfVHDOWMOCYxPW0HZZQjMADcIFn1xBtHC OebEFPA3BGt3vmyS6Q67o3x7gqPrFAIuhPuFLjX3pJ4sBxVfGa2Zds+Pua6TGn/11GCx AfXQEMhu9SIqDwWUPm+/5Knb4BopH0dbynk/JSq31N0XsM8TptjTluYrdarXi5o++NxX zSfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GPOY2d2iNuO65egkCFZw3rXLU46LbwzRq0Gho1bvrl4=; b=VaJXt9e/0WmjRVy6t6LsknHmkdiASF4qrGBGjKFm5gUWDCpQxFKBAREOByDBgWd7vS +qn29PTUV0ujCYLWeJtmuvi9M8lddV6l0wvJqp0tUmCPqfKYtX408NNBv9jh5vt1t/b/ cdVia2/4x2hQrU73pcoI/agakUYFXoT9hMLIhVO2GuhJl4tGx5FlrPMYfk3hW2ntE39V z8zwh02V2QC3xefbnhdVnBdzCKJq/DJLeKprYoATofYsu9vtwrGV+Ok7ITieOA09Dd2t mc1TrEszKKpnM+/reUCDlm0M/1l1LlqNYMfLgOE6YJpRvLrp786WXIARBZi9PtaG32Km 1zDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="gYTL0x/S"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n28-20020a638f1c000000b003fa02682fcasi4822256pgd.548.2022.05.23.00.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:14:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="gYTL0x/S"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 59B057DE00; Sun, 22 May 2022 23:33:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354361AbiEUCfB (ORCPT + 99 others); Fri, 20 May 2022 22:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354350AbiEUCe7 (ORCPT ); Fri, 20 May 2022 22:34:59 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9200617996A for ; Fri, 20 May 2022 19:34:57 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id v6so6090368qtx.12 for ; Fri, 20 May 2022 19:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GPOY2d2iNuO65egkCFZw3rXLU46LbwzRq0Gho1bvrl4=; b=gYTL0x/S9SWMzL5yr5pHjL2Os0iUM04qyTCySwDHjdtl4ZDNWVsWyGNPYQTmwR+Wa5 vVvdRd0+/BHBjj+ZE+kimSd/G5xlwM+XO/ecdcutR1uZwUMaxdUWmyB2RMOqH+6zgwko ggJRNM7RXDYfxEO2YdBlTCPs9OiAGlPOnrs9/BOwORDAc5THxIwoVjG1ZxrNO1Wqp1un Xae4Tn5esHxugHU4Md0EVA17aJQTl0MJwZ9IfrTBn0P1+CYouofVbq7Gs1KNJI9rt+Lq hDWArAengQ0djrKjfvMKg39LWXmqeEcUV8yYVD9rNhDOPtjQrbnxQlXYRbWwysYvePbD P4Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GPOY2d2iNuO65egkCFZw3rXLU46LbwzRq0Gho1bvrl4=; b=qxdHwMNW3kaa8Ge1MAB0rNQ2DAE6DP6a7emChiAk2nbbT59Cpndrle/C8ZOlFbCCat xtUXU4VBJJvm1vIawi8N2XG1t6B8c9iUNR2rwyqt/q4Ohz3NVj4xX07wBapDL2ggv7SO wVGGdNJLTMpziaB5XdWXddlHCcy+1SDljmZF2MEVKy7MsAeY/wDs/Amc3CXDPlnrztcG Drk9PpcBcxfbzHe4j6PikKjYDWS6Qq/FeY8um2Gf5ua4yktCyPCS7wQdlsSdeI4FwHKD hwxL4ossueMWao1Nsi/Hotyscv3k8XTakTinvi8rFaAqoi9y29DC/3l0gCJq7bwx03Zu b0rA== X-Gm-Message-State: AOAM532+yX4ouH2VnXvs+MjQep1symN8ra0GsknFHhIMcHBC+e/TL8sT b5BxEqIuZuuDSSoFadIYPIYiPogn/7fAOkzRO+fqNg== X-Received: by 2002:ac8:5845:0:b0:2f9:1c6a:f65f with SMTP id h5-20020ac85845000000b002f91c6af65fmr5026503qth.168.1653100496556; Fri, 20 May 2022 19:34:56 -0700 (PDT) MIME-Version: 1.0 References: <20220520012133.1217211-1-yosryahmed@google.com> <20220520012133.1217211-4-yosryahmed@google.com> <73fd9853-5dab-8b59-24a0-74c0a6cae88e@fb.com> <20220520221919.jnqgv52k4ajlgzcl@MBP-98dd607d3435.dhcp.thefacebook.com> <5b301151-0a65-df43-3a3a-6d57e10cfc2d@fb.com> In-Reply-To: <5b301151-0a65-df43-3a3a-6d57e10cfc2d@fb.com> From: Hao Luo Date: Fri, 20 May 2022 19:34:45 -0700 Message-ID: Subject: Re: [PATCH bpf-next v1 3/5] bpf: Introduce cgroup iter To: Yonghong Song Cc: Tejun Heo , Alexei Starovoitov , Yosry Ahmed , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , Zefan Li , Johannes Weiner , Shuah Khan , Roman Gushchin , Michal Hocko , Stanislav Fomichev , David Rientjes , Greg Thelen , Shakeel Butt , Linux Kernel Mailing List , Networking , bpf , Cgroups Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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, May 20, 2022 at 5:59 PM Yonghong Song wrote: > On 5/20/22 3:57 PM, Tejun Heo wrote: > > Hello, > > > > On Fri, May 20, 2022 at 03:19:19PM -0700, Alexei Starovoitov wrote: > >> We have bpf_map iterator that walks all bpf maps. > >> When map iterator is parametrized with map_fd the iterator walks > >> all elements of that map. > >> cgroup iterator should have similar semantics. > >> When non-parameterized it will walk all cgroups and their descendent > >> depth first way. I believe that's what Yonghong is proposing. > >> When parametrized it will start from that particular cgroup and > >> walk all descendant of that cgroup only. > >> The bpf prog can stop the iteration right away with ret 1. > >> Maybe we can add two parameters. One -> cgroup_fd to use and another -> > >> the order of iteration css_for_each_descendant_pre vs _post. > >> wdyt? > > > > Sounds perfectly reasonable to me. > > This works for me too. Thanks! > This sounds good to me. Thanks. Let's try to do it in the next iteration.