bpf: Use the call graph to choose subprogs with a private stack
Whether a subprog has its frame in the private stack depends on the prog,
on the size of the frame, and on its callers: no async callback may get to
the subprog. An async callback can run on top of the main prog on the same
cpu, and both would use the same frame.
The walk of the chains of calls gets the last condition from its order. It
starts at the async callbacks and marks what it visits as NO_PRIV_STACK.
The main prog comes last and takes what is not marked.
In the call graph "the async callbacks and what they get to" is a set. The
mode of every subprog is known before the walk starts, and the walk only
adds up the frames.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261104215523.1852636-6-alexei.starovoitov@gmail.com
1 file changed