[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z5fyzMjj_5gqOupB@ghost>
Date: Mon, 27 Jan 2025 12:55:40 -0800
From: Charlie Jenkins <charlie@...osinc.com>
To: "Maciej W. Rozycki" <macro@...am.me.uk>
Cc: Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Alexandre Ghiti <alexghiti@...osinc.com>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
loongarch@...ts.linux.dev
Subject: Re: [PATCH 1/4] riscv: entry: Convert ret_from_fork() to C
On Mon, Jan 27, 2025 at 08:20:56PM +0000, Maciej W. Rozycki wrote:
> On Sun, 26 Jan 2025, Charlie Jenkins wrote:
>
> > > Wouldn't it make sense to save a jump here and make it a tail call, i.e.:
> > >
> > > la ra, ret_from_exception
> > > tail ret_from_fork
> > >
> >
> > I don't believe so due to the return address stack. It was shown in this
> > patch [1] that a 7% performance improvement can be seen on existing
> > riscv hardware by performing the extra jump. Doing tail calls should be
> > avoided on riscv since the hardware can be expected to predict the
> > return address incorrectly every time if the return address is manually
> > changed.
>
> Fair enough, thanks. Though no link to said patch given.
Oops! Here it is:
https://lore.kernel.org/linux-riscv/20240607061335.2197383-1-cyrilbur@tenstorrent.com/.
>
> Maciej
Powered by blists - more mailing lists