public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Yonghong Song <yonghong.song@linux.dev>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	kernel-team@fb.com, Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH bpf-next v10 6/7] bpf: Support private stack for struct_ops progs
Date: Thu, 7 Nov 2024 09:20:55 -1000	[thread overview]
Message-ID: <Zy0TF132HobbRZ4Z@slm.duckdns.org> (raw)
In-Reply-To: <20241107024209.3357227-1-yonghong.song@linux.dev>

On Wed, Nov 06, 2024 at 06:42:09PM -0800, Yonghong Song wrote:
> For struct_ops progs, whether a particular prog uses private stack
> depends on prog->aux->priv_stack_requested setting before actual
> insn-level verification for that prog. One particular implementation
> is to piggyback on struct_ops->check_member(). The next patch has
> an example for this. The struct_ops->check_member() sets
> prog->aux->priv_stack_requested to be true which enables private stack
> usage.
> 
> The struct_ops prog follows the same rule as kprobe/tracing progs after
> function bpf_enable_priv_stack(). For example, even a struct_ops prog
> requests private stack, it could still use normal kernel stack if
> the stack size is small (< 64 bytes).
> 
> The prog->aux->priv_stack_requested is also used for recursion checking
> for struct_ops progs. Similar to tracing progs, nested same cpu same
> prog run will be skipped. A field (recursion_detected()) is added to
> bpf_prog_aux structure. If bpf_prog->aux->recursion_detected
> is implemented by the struct_ops subsystem and nested same cpu/prog
> happens, the function will be triggered to report an error, collect
> related info, etc.
> 
> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>

From user's POV, this looks great:

 Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

  reply	other threads:[~2024-11-07 19:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07  2:41 [PATCH bpf-next v10 0/7] bpf: Support private stack for bpf progs Yonghong Song
2024-11-07  2:41 ` [PATCH bpf-next v10 1/7] bpf: Find eligible subprogs for private stack support Yonghong Song
2024-11-07  2:41 ` [PATCH bpf-next v10 2/7] bpf: Enable private stack for eligible subprogs Yonghong Song
2024-11-08 19:11   ` Alexei Starovoitov
2024-11-08 21:41     ` Yonghong Song
2024-11-07  2:41 ` [PATCH bpf-next v10 3/7] bpf, x86: Avoid repeated usage of bpf_prog->aux->stack_depth Yonghong Song
2024-11-07  2:41 ` [PATCH bpf-next v10 4/7] bpf, x86: Support private stack in jit Yonghong Song
2024-11-07  2:42 ` [PATCH bpf-next v10 5/7] selftests/bpf: Add tracing prog private stack tests Yonghong Song
2024-11-07  2:42 ` [PATCH bpf-next v10 6/7] bpf: Support private stack for struct_ops progs Yonghong Song
2024-11-07 19:20   ` Tejun Heo [this message]
2024-11-07  2:42 ` [PATCH bpf-next v10 7/7] selftests/bpf: Add struct_ops prog private stack tests Yonghong Song

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=Zy0TF132HobbRZ4Z@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox