[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <63e4017f-dcdd-4c28-9591-1ce7f0e9b761@infradead.org>
Date: Sun, 24 Mar 2024 10:19:06 +0900
From: Geoff Levand <geoff@...radead.org>
To: Arnd Bergmann <arnd@...db.de>, Geert Uytterhoeven <geert@...ux-m68k.org>,
Arnd Bergmann <arnd@...nel.org>
Cc: llvm@...ts.linux.dev, Kevin Hao <haokexin@...il.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>, linux-kernel@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>, Nicholas Piggin <npiggin@...il.com>,
Justin Stitt <justinstitt@...gle.com>,
"Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>, linuxppc-dev@...ts.ozlabs.org,
Bill Wendling <morbo@...gle.com>
Subject: Re: [PATCH] powerpc: ps3: mark ps3_notification_device static for
stack usage
On 3/23/24 05:24, Arnd Bergmann wrote:
> On Fri, Mar 22, 2024, at 09:34, Geoff Levand wrote:
>> On 3/21/24 17:32, Geert Uytterhoeven wrote:
>>> --- a/arch/powerpc/platforms/ps3/device-init.c
>>>> +++ b/arch/powerpc/platforms/ps3/device-init.c
>>>> @@ -770,7 +770,7 @@ static struct task_struct *probe_task;
>>>>
>>>> static int ps3_probe_thread(void *data)
>>>> {
>>>> - struct ps3_notification_device dev;
>>>> + static struct ps3_notification_device dev;
>>>> int res;
>>>> unsigned int irq;
>>>> u64 lpar;
>>>
>>> Making it static increases kernel size for everyone. So I'd rather
>>> allocate it dynamically. The thread already allocates a buffer, which
>>> can be replaced at no cost by allocating a structure containing both
>>> the ps3_notification_device and the buffer.
>
> I didn't think it mattered much, given that you would rarely
> have a kernel with PS3 support along with other platforms.
>
> I suppose it does increase the size for a PS3-only kernel
> as well, while your version makes it smaller.
>
>> Here's what I came up with. It builds for me without warnings.
>> I haven't tested it yet. A review would be appreciated.
>
> It seems a little complicated but looks all correct to
> me and reduces both stack and .data size, so
>
> Acked-by: Arnd Bergmann <arnd@...db.de>
Thanks Arnd. I also thought it was a bit too much. I made a simpler
version that I'll post as a separate message.
-Geoff
Powered by blists - more mailing lists