From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
rostedt <rostedt@goodmis.org>,
"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
Indu Bhagat <indu.bhagat@oracle.com>,
"carlos@redhat.com" <carlos@redhat.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
"Jose E. Marchesi" <jose.marchesi@oracle.com>,
Mark Rutland <mark.rutland@arm.com>,
Brian Robbins <brianrob@microsoft.com>,
Diamon discuss <diamon-discuss@lists.linuxfoundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Summary of discussion following LPC2023 sframe talk
Date: Fri, 1 Dec 2023 11:08:41 -0800 [thread overview]
Message-ID: <20231201190841.z5flmsmzectrlrew@treble> (raw)
In-Reply-To: <20231115154912.GC8262@noisy.programming.kicks-ass.net>
On Wed, Nov 15, 2023 at 04:49:12PM +0100, Peter Zijlstra wrote:
> > - JITs:
> >
> > - There are two approaches to skip over JITted code stacks:
> >
> > - If the jitted code has frame pointers, then use this.
> >
> > - If we figure out that some JITs do not have frame pointers, then
> > we would need to design a new kernel ABI that would allow JITs
> > to express sframe-alike information. This will need to be designed
> > with the input of JIT communities because some of them are likely
> > not psABI compliant (e.g. lua has a separate stack).
>
> Why a new interface? They can use the same prctl() as above. Here text,
> there sframe.
Our thinking was that a syscall defeats the point of "just in time".
> > - When we have a good understanding of the JIT requirements in terms
> > of frame description content, the other element that would need to
> > be solved is how to allow JITs to emit frame data in a data structure
> > that can expand. We may need something like a reserved memory area, with
> > a counter of the number of elements which is used to synchronize communication
> > between the JITs (producer) and kernel (consumer).
>
> Again, huh?! Expand? Typical JIT has the normal epoch like approach to
> text generation, have N>1 text windows, JIT into one until full, once
> full, copy all still active crap into second window, induce grace period
> and wipe first window, rince-repeat.
>
> Just have a sframe thing per window and expand the definition of 'full'
> to be either text of sframe window is full and everything should just
> work, no?
Yes, assuming the JIT doesn't mind doing a syscall.
> > - We may have to create frame description areas which content are specific to given
> > JITs. For instance, the frame descriptions for a lua JIT on x86-64 may not follow
> > the x86-64 regular psABI.
> >
> > - As an initial stage, we can focus on handling the sframe section for executable
> > and shared objects, and use frame pointers to skip over JITted code if available.
> > The goal here is to show the usefulness of this kind of information so we get
> > the interest/collaboration needed to get the relevant input from JIT communities
> > as we design the proper ABI for handling JIT frames.
>
> As per: https://realpython.com/python312-perf-profiler/
>
> There is some 'demand' for all this, might be useful to contact some JIT
> authors and have them detail their needs or something.
If there's no sframe then we can just fall back to frame pointers like
ORC does. And that article recommends enabling frame pointers for
python.
Between that and prctl(), it may be enough.
--
Josh
next prev parent reply other threads:[~2023-12-01 19:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 15:09 Summary of discussion following LPC2023 sframe talk Mathieu Desnoyers
2023-11-15 15:49 ` Peter Zijlstra
2023-12-01 19:08 ` Josh Poimboeuf [this message]
2023-12-01 19:47 ` Mathieu Desnoyers
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=20231201190841.z5flmsmzectrlrew@treble \
--to=jpoimboe@kernel.org \
--cc=brianrob@microsoft.com \
--cc=carlos@redhat.com \
--cc=diamon-discuss@lists.linuxfoundation.org \
--cc=indu.bhagat@oracle.com \
--cc=jose.marchesi@oracle.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.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