All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: Yosry Ahmed <yosryahmed@google.com>, Tejun Heo <tj@kernel.org>
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, Zefan Li <lizefan.x@bytedance.com>,
	Johannes Weiner <hannes@cmpxchg.org>, Yonghong Song <yhs@fb.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, Song Liu <song@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>
Subject: Re: [PATCH v2 2/2] bpf: cgroup_iter: support cgroup1 using cgroup fd
Date: Tue, 11 Oct 2022 09:46:27 -0700	[thread overview]
Message-ID: <2ba0ee79-2e7e-6807-3312-1a2c5ef3bae0@linux.dev> (raw)
In-Reply-To: <20221011003359.3475263-3-yosryahmed@google.com>

On 10/10/22 5:33 PM, Yosry Ahmed wrote:
> Use cgroup_v1v2_get_from_fd() in cgroup_iter to support attaching to
> both cgroup v1 and v2 using fds.
> 
> Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
> ---
>   kernel/bpf/cgroup_iter.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/bpf/cgroup_iter.c b/kernel/bpf/cgroup_iter.c
> index 0d200a993489..9fcf09f2ef00 100644
> --- a/kernel/bpf/cgroup_iter.c
> +++ b/kernel/bpf/cgroup_iter.c
> @@ -196,7 +196,7 @@ static int bpf_iter_attach_cgroup(struct bpf_prog *prog,
>   		return -EINVAL;
>   
>   	if (fd)
> -		cgrp = cgroup_get_from_fd(fd);
> +		cgrp = cgroup_v1v2_get_from_fd(fd);

Acked-by: Martin KaFai Lau <martin.lau@kernel.org>

Tejun, patch 1 should depend on a recent revert that is not in the bpf tree yet. 
  Do you want to take this set to the cgroup tree?

>   	else if (id)
>   		cgrp = cgroup_get_from_id(id);
>   	else /* walk the entire hierarchy by default. */


WARNING: multiple messages have this Message-ID (diff)
From: Martin KaFai Lau <martin.lau-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>
To: Yosry Ahmed <yosryahmed-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	bpf-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Zefan Li <lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	Yonghong Song <yhs-b10kYP2dOMg@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>,
	Song Liu <song-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	John Fastabend
	<john.fastabend-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	KP Singh <kpsingh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Stanislav Fomichev <sdf-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Hao Luo <haoluo-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Jiri Olsa <jolsa-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH v2 2/2] bpf: cgroup_iter: support cgroup1 using cgroup fd
Date: Tue, 11 Oct 2022 09:46:27 -0700	[thread overview]
Message-ID: <2ba0ee79-2e7e-6807-3312-1a2c5ef3bae0@linux.dev> (raw)
In-Reply-To: <20221011003359.3475263-3-yosryahmed-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

On 10/10/22 5:33 PM, Yosry Ahmed wrote:
> Use cgroup_v1v2_get_from_fd() in cgroup_iter to support attaching to
> both cgroup v1 and v2 using fds.
> 
> Signed-off-by: Yosry Ahmed <yosryahmed-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> ---
>   kernel/bpf/cgroup_iter.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/bpf/cgroup_iter.c b/kernel/bpf/cgroup_iter.c
> index 0d200a993489..9fcf09f2ef00 100644
> --- a/kernel/bpf/cgroup_iter.c
> +++ b/kernel/bpf/cgroup_iter.c
> @@ -196,7 +196,7 @@ static int bpf_iter_attach_cgroup(struct bpf_prog *prog,
>   		return -EINVAL;
>   
>   	if (fd)
> -		cgrp = cgroup_get_from_fd(fd);
> +		cgrp = cgroup_v1v2_get_from_fd(fd);

Acked-by: Martin KaFai Lau <martin.lau-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Tejun, patch 1 should depend on a recent revert that is not in the bpf tree yet. 
  Do you want to take this set to the cgroup tree?

>   	else if (id)
>   		cgrp = cgroup_get_from_id(id);
>   	else /* walk the entire hierarchy by default. */


  reply	other threads:[~2022-10-11 16:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11  0:33 [PATCH v2 0/2] Support cgroup1 in get from fd/file interfaces Yosry Ahmed
2022-10-11  0:33 ` Yosry Ahmed
2022-10-11  0:33 ` [PATCH v2 1/2] cgroup: add cgroup_v1v2_get_from_[fd/file]() Yosry Ahmed
2022-10-11  0:33 ` [PATCH v2 2/2] bpf: cgroup_iter: support cgroup1 using cgroup fd Yosry Ahmed
2022-10-11 16:46   ` Martin KaFai Lau [this message]
2022-10-11 16:46     ` Martin KaFai Lau
2022-10-11 16:49     ` Tejun Heo
2022-10-11 16:51 ` [PATCH v2 0/2] Support cgroup1 in get from fd/file interfaces Tejun Heo

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=2ba0ee79-2e7e-6807-3312-1a2c5ef3bae0@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hannes@cmpxchg.org \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=tj@kernel.org \
    --cc=yhs@fb.com \
    --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.