Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3269466lfo; Mon, 23 May 2022 00:21:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0CFVySA8hAO6/MDWIwMfSxYWTs8yqjGARMZPdbLO7cpix5tsKIkXtvpAXedIZpVrtPv14 X-Received: by 2002:a65:4007:0:b0:3c6:c6e2:1ccc with SMTP id f7-20020a654007000000b003c6c6e21cccmr18832872pgp.500.1653290498695; Mon, 23 May 2022 00:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653290498; cv=none; d=google.com; s=arc-20160816; b=VdfrmRBA2dc8lXFSOucMn6X2Wt7oTSe6DKMeGomWdN3xnzPpG7CjdkB8KHd+KR5SNU iLF9hySEyUR3PnHT2n0ysdDZi6567qHERzbXc1A3Mudkav9kRGdOwmzlVEIeJBr6odt0 GayJ5z5Vu0b8WiqS20y/fkRYKoArnbDjQ1oCPDrV5apHugrKI9OTpbIXDA8n+buSAIYt FPzJJ9OQV9SZvuXpwbioIOfVXXhIxdTC658N0hM6O49OKMYwk3RYBdZGdHLi6+NL8+ay TmFpbtILQKJUDCixEO6cIOp3oGqb49FUN7ltpUMdTmDEmmk/4IoR0BpYUgLXfg0uNems Q+6Q== 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=r7Opvf9nRKqDGanqTkuAv5bdGKe48qHrMle6WOzLLy4=; b=b2uZlkRoF6bBVdWkGpfmyt30PrmFz0PhSGiee0cfRcGazQfDzRvmn82mo3AK0eW0bw 7C9WHlouiVfk+HV1PJKf5R7PPRDrwGbS5n92Il1Uhckbjk2A54PWvmhVhZCkJ81/KzeC DQOO1MVLv3KhCORtUc81r12CA5+VA26ylnsWq6+uSMz05k3Ue0WmeKNygxX1LfCCZ+2i +EmD5gXH67yj6JFqo/bx24MhyRh8mDF/DkLTMTqFjgs7W0/tZp85fkruT1JcTTq8UbuR 2I2DjzT73CNgX9tT4tA+sDmL+b3gjxz1qp+lOVjzcub0m8ePLl4o/jChghSD1ulHYuLk cc6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iXgcDMaO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k62-20020a638441000000b003f9f28dde0csi7779933pgd.255.2022.05.23.00.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:21:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iXgcDMaO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 733B71B7A7; Sun, 22 May 2022 23:37:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353981AbiETW5Z (ORCPT + 99 others); Fri, 20 May 2022 18:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230504AbiETW5Y (ORCPT ); Fri, 20 May 2022 18:57:24 -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 2DC6417B866; Fri, 20 May 2022 15:57:23 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id ev18so9201696pjb.4; Fri, 20 May 2022 15:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=r7Opvf9nRKqDGanqTkuAv5bdGKe48qHrMle6WOzLLy4=; b=iXgcDMaOaeCEyfvPGiDLf+JCC1kzNqqtGmkx+d+d6UQJ076JtKpP6CF7i2x5rzP5Aw UIPYy2I3NpQN5LvyUZB7XvDI65W0Fu29aXupm9j0Zk1h2ZjmGr6WCXjlfh9PTPNzzalM gOt+D5nzzQci6Xgm5jUaL0idRC96bgpY9f4aO4wWr4MHP9eX6ozcVTwTQDkSMhTHcFfE I6Bfxg6//tmrDvAGeYgnbQtmjvdGldw9LgjSE1kuwJOwm5KQN2YaH7qKNueHRPBUGHz4 ZE1otEiFCGKKdXivVJI0fWpjry+B1CzGY3DLdHD5+YWNf1DE+Z3JCtVunAuebaZGUfvF smHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=r7Opvf9nRKqDGanqTkuAv5bdGKe48qHrMle6WOzLLy4=; b=cqyEcO9l//WULdNsE9Ue835i30DnWoS2jHAJ3crPs2mPKA/U9htvh1rXiqoP/W8M0X w0xq/KsAzxNVBp0+O0lPfr5iARxl+ZJGmKN5b+6n6z6whliQrvRbCkelnXaSEliMKgQc o4kVj96dQeUxIsl7Pas31MDICRmIxCOWTKHyg/Ma9AazhzZowsbbsRpGL/Ru8QxhtFy2 RjZNfLrHraQCQNciBsQDwwmuCVZ2dqYoN+fks4rUKJuNZfRVMGG6nozzOrQ9pK2mv0pT V2w03pGt8nvtJJyAE8MPFBKmxhRekf9Xqq8y8s9x+4mCl5bl8wk4cZDNZLsoPZlHaZ4E zDiA== X-Gm-Message-State: AOAM530nS37JSXhSnqEhqvJnlsco4IbEudGET4CDTeGYSvGj7JNiIOY4 bCenPQO+Rfue1FCfBrAcPe8= X-Received: by 2002:a17:90b:1808:b0:1dc:8904:76a1 with SMTP id lw8-20020a17090b180800b001dc890476a1mr13466621pjb.202.1653087442583; Fri, 20 May 2022 15:57:22 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::4:1761]) by smtp.gmail.com with ESMTPSA id h11-20020a170902f2cb00b0015f33717794sm264975plc.42.2022.05.20.15.57.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 15:57:21 -0700 (PDT) Sender: Tejun Heo Date: Fri, 20 May 2022 12:57:20 -1000 From: Tejun Heo To: Alexei Starovoitov Cc: Yosry Ahmed , Hao Luo , Yonghong Song , 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 Subject: Re: [PATCH bpf-next v1 3/5] bpf: Introduce cgroup iter Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220520221919.jnqgv52k4ajlgzcl@MBP-98dd607d3435.dhcp.thefacebook.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, 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 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. Thanks. -- tejun