All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Tejun Heo <tj@kernel.org>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Yosry Ahmed <yosryahmed@google.com>, Hao Luo <haoluo@google.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>, Zefan Li <lizefan.x@bytedance.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Shuah Khan <shuah@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Michal Hocko <mhocko@kernel.org>,
	Stanislav Fomichev <sdf@google.com>,
	David Rientjes <rientjes@google.com>,
	Greg Thelen <gthelen@google.com>,
	Shakeel Butt <shakeelb@google.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
	Cgroups <cgroups@vger.kernel.org>
Subject: Re: [PATCH bpf-next v1 3/5] bpf: Introduce cgroup iter
Date: Fri, 20 May 2022 17:59:21 -0700	[thread overview]
Message-ID: <5b301151-0a65-df43-3a3a-6d57e10cfc2d@fb.com> (raw)
In-Reply-To: <Yogc0Kb5ZVDaQ0oU@slm.duckdns.org>



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!

> 
> Thanks.
> 

WARNING: multiple messages have this Message-ID (diff)
From: Yonghong Song <yhs-b10kYP2dOMg@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Alexei Starovoitov
	<alexei.starovoitov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Yosry Ahmed <yosryahmed-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Hao Luo <haoluo-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Alexei Starovoitov <ast-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Daniel Borkmann <daniel-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org>,
	Andrii Nakryiko <andrii-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Martin KaFai Lau <kafai-b10kYP2dOMg@public.gmane.org>,
	Song Liu <songliubraving-b10kYP2dOMg@public.gmane.org>,
	John Fastabend
	<john.fastabend-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	KP Singh <kpsingh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Zefan Li <lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	Shuah Khan <shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Roman Gushchin
	<roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>,
	Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Stanislav Fomichev <sdf-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	David Rientjes <rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Shakeel Butt <shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Networking <netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	bpf <>
Subject: Re: [PATCH bpf-next v1 3/5] bpf: Introduce cgroup iter
Date: Fri, 20 May 2022 17:59:21 -0700	[thread overview]
Message-ID: <5b301151-0a65-df43-3a3a-6d57e10cfc2d@fb.com> (raw)
In-Reply-To: <Yogc0Kb5ZVDaQ0oU-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>



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!

> 
> Thanks.
> 

  reply	other threads:[~2022-05-21  0:59 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20  1:21 [PATCH bpf-next v1 0/5] bpf: rstat: cgroup hierarchical stats Yosry Ahmed
2022-05-20  1:21 ` Yosry Ahmed
2022-05-20  1:21 ` [PATCH bpf-next v1 1/5] cgroup: bpf: add a hook for bpf progs to attach to rstat flushing Yosry Ahmed
2022-05-21 11:16   ` kernel test robot
2022-05-21 11:16     ` kernel test robot
2022-05-21 11:26   ` kernel test robot
2022-05-21 11:26     ` kernel test robot
2022-05-21 11:26   ` kernel test robot
2022-05-21 11:26     ` kernel test robot
2022-05-20  1:21 ` [PATCH bpf-next v1 2/5] cgroup: bpf: add cgroup_rstat_updated() and cgroup_rstat_flush() kfuncs Yosry Ahmed
2022-05-20  1:21   ` Yosry Ahmed
2022-05-20  7:24   ` Tejun Heo
2022-05-20  7:24     ` Tejun Heo
2022-05-20  9:13     ` Yosry Ahmed
2022-05-20  9:13       ` Yosry Ahmed
2022-05-20  9:36       ` Kumar Kartikeya Dwivedi
2022-05-20  9:36         ` Kumar Kartikeya Dwivedi
2022-05-20 11:16         ` Tejun Heo
2022-05-20 11:16           ` Tejun Heo
2022-05-20 16:06           ` Yosry Ahmed
2022-05-20 16:06             ` Yosry Ahmed
2022-05-20 15:14   ` Yonghong Song
2022-05-20 16:08     ` Yosry Ahmed
2022-05-20 16:08       ` Yosry Ahmed
2022-05-20 16:16       ` Yonghong Song
2022-05-20 16:16         ` Yonghong Song
2022-05-20 16:20         ` Yosry Ahmed
2022-05-20 16:20           ` Yosry Ahmed
2022-05-21 11:47   ` kernel test robot
2022-05-21 11:47     ` kernel test robot
2022-05-20  1:21 ` [PATCH bpf-next v1 3/5] bpf: Introduce cgroup iter Yosry Ahmed
2022-05-20  7:41   ` Tejun Heo
2022-05-20  7:41     ` Tejun Heo
2022-05-20  7:58     ` Yosry Ahmed
2022-05-20  7:58       ` Yosry Ahmed
2022-05-20  8:11       ` Tejun Heo
2022-05-20  8:11         ` Tejun Heo
2022-05-20 11:27         ` Tejun Heo
2022-05-20 11:27           ` Tejun Heo
2022-05-20 16:29         ` Yonghong Song
2022-05-20 16:29           ` Yonghong Song
2022-05-20 16:45           ` Tejun Heo
2022-05-20 16:45             ` Tejun Heo
2022-05-20 19:42             ` Hao Luo
2022-05-20 19:42               ` Hao Luo
2022-05-20 21:18               ` Yosry Ahmed
2022-05-20 21:18                 ` Yosry Ahmed
2022-05-20 22:19                 ` Alexei Starovoitov
2022-05-20 22:19                   ` Alexei Starovoitov
2022-05-20 22:36                   ` Yosry Ahmed
2022-05-20 22:36                     ` Yosry Ahmed
2022-05-20 22:57                   ` Tejun Heo
2022-05-20 22:57                     ` Tejun Heo
2022-05-21  0:59                     ` Yonghong Song [this message]
2022-05-21  0:59                       ` Yonghong Song
2022-05-21  2:34                       ` Hao Luo
2022-05-21  2:34                         ` Hao Luo
2022-05-23 23:58                         ` Andrii Nakryiko
2022-05-23 23:58                           ` Andrii Nakryiko
2022-05-24  0:53                           ` Hao Luo
2022-05-24  0:53                             ` Hao Luo
2022-05-24  1:30                             ` Andrii Nakryiko
2022-05-24  1:30                               ` Andrii Nakryiko
2022-05-20 21:49               ` Hao Luo
2022-05-20 21:49                 ` Hao Luo
2022-05-21  0:58                 ` Yonghong Song
2022-05-21  0:58                   ` Yonghong Song
2022-05-21  2:43                   ` Hao Luo
2022-05-21  2:43                     ` Hao Luo
2022-05-21  4:53                     ` Tejun Heo
2022-05-21  4:53                       ` Tejun Heo
2022-05-21  0:52             ` Yonghong Song
2022-05-21  0:52               ` Yonghong Song
2022-05-20 17:30         ` Hao Luo
2022-05-20 17:30           ` Hao Luo
2022-05-20  1:21 ` [PATCH bpf-next v1 4/5] selftests/bpf: extend cgroup helpers Yosry Ahmed
2022-05-20  1:21 ` [PATCH bpf-next v1 5/5] bpf: add a selftest for cgroup hierarchical stats collection Yosry Ahmed
2022-05-20 16:09   ` Yonghong Song
2022-05-20 16:18     ` Yosry Ahmed
2022-05-20 16:18       ` Yosry Ahmed
2022-05-24  0:01       ` Andrii Nakryiko
2022-05-24  0:01         ` Andrii Nakryiko
2022-05-24  2:35         ` Yosry Ahmed
2022-05-24  2:35           ` Yosry Ahmed
2022-06-03 16:23   ` Michal Koutný
2022-06-03 16:23     ` Michal Koutný
2022-06-03 19:52     ` Yosry Ahmed
2022-06-03 19:52       ` Yosry Ahmed
2022-06-06 12:32       ` Michal Koutný
2022-06-06 12:32         ` Michal Koutný
2022-06-06 19:41         ` Yosry Ahmed
2022-06-06 19:41           ` Yosry Ahmed
2022-06-07 12:12           ` Michal Koutný
2022-06-07 12:12             ` Michal Koutný
2022-06-07 17:43             ` Yosry Ahmed
2022-06-07 17:43               ` Yosry Ahmed
2022-06-08 11:17               ` Michal Koutný
2022-06-08 11:17                 ` Michal Koutný
2022-06-03 16:22 ` [PATCH bpf-next v1 0/5] bpf: rstat: cgroup hierarchical stats Michal Koutný
2022-06-03 16:22   ` Michal Koutný
2022-06-03 19:47   ` Yosry Ahmed
2022-06-03 19:47     ` Yosry Ahmed
2022-06-06 12:32     ` Michal Koutný
2022-06-06 12:32       ` Michal Koutný
2022-06-06 19:32       ` Yosry Ahmed
2022-06-06 19:32         ` Yosry Ahmed
2022-06-06 19:54         ` Kumar Kartikeya Dwivedi
2022-06-06 19:54           ` Kumar Kartikeya Dwivedi
2022-06-06 20:00           ` Yosry Ahmed
2022-06-06 20:00             ` Yosry Ahmed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b301151-0a65-df43-3a3a-6d57e10cfc2d@fb.com \
    --to=yhs@fb.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=gthelen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mhocko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=sdf@google.com \
    --cc=shakeelb@google.com \
    --cc=shuah@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=tj@kernel.org \
    --cc=yosryahmed@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.