On 9/12/21 10:48 AM, Hsuan-Chi Kuo wrote:
Hi,
The function check_max_stack_depth
(https://elixir.bootlin.com/linux/latest/source/kernel/bpf/verifier.c#L3574
) is used to ensure the stack size is no greater than 8KB.
The stack can only grow over 8KB because of tail calls as they only
unwind the current stack frame. I wonder why not make tail call reset
the stack since what was on the stack
will never be used again?
I think this is just an artifact of current implementation.
To do a correct reset of the stack, additional instructions
are needed to keep track and accumulate stack size properly,
so when a tail call is reached, it knows how much stack size
to reset.
Did you hit this limitation? Could you describe your use case
in detail?
Thanks