bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hsuan-Chi Kuo <hsuanchikuo@gmail.com>
To: bpf@vger.kernel.org
Subject: Why does tail call only unwind the current stack frame instead of resetting the current stack?
Date: Sun, 12 Sep 2021 12:48:25 -0500	[thread overview]
Message-ID: <93b37b05-3aab-3e50-bd1b-e97a8d5776f2@gmail.com> (raw)

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?


Thanks


             reply	other threads:[~2021-09-12 17:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 17:48 Hsuan-Chi Kuo [this message]
2021-09-13  4:08 ` Why does tail call only unwind the current stack frame instead of resetting the current stack? Yonghong Song
2021-09-13  5:04   ` Hsuan-Chi Kuo
2021-09-13 16:32     ` Alexei Starovoitov

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=93b37b05-3aab-3e50-bd1b-e97a8d5776f2@gmail.com \
    --to=hsuanchikuo@gmail.com \
    --cc=bpf@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).