[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f2b17529-e1b6-3d2c-a38b-51e91841e438@csgroup.eu>
Date: Tue, 9 Feb 2021 17:13:17 +0100
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Nicholas Piggin <npiggin@...il.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Michael Ellerman <mpe@...erman.id.au>, msuchanek@...e.de,
Paul Mackerras <paulus@...ba.org>
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v5 16/22] powerpc/syscall: Avoid stack frame in likely
part of system_call_exception()
Le 09/02/2021 à 02:55, Nicholas Piggin a écrit :
> Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am:
>> When r3 is not modified, reload it from regs->orig_r3 to free
>> volatile registers. This avoids a stack frame for the likely part
>> of system_call_exception()
>
> This doesn't on my 64s build, but it does reduce one non volatile
> register save/restore. With quite a bit more register pressure
> reduction 64s can avoid the stack frame as well.
The stack frame is not due to the registers because on PPC64 you have the redzone that you don't
have on PPC32.
As far as I can see, this is due to a call to .arch_local_irq_restore().
On ppc32 arch_local_irq_restore() is just a write to MSR.
>
> It's a cool trick but quite code and compiler specific so I don't know
> how worthwhile it is to keep considering we're calling out into random
> kernel C code after this.
>
> Maybe just keep it PPC32 specific for the moment, will have to do more
> tuning for 64 and we have other stuff to do there first.
>
> If you are happy to make it 32-bit only then
I think we can leave without this, that's only one or two cycles won.
>
> Reviewed-by: Nicholas Piggin <npiggin@...il.com>
>
Powered by blists - more mailing lists