From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9359981E; Sun, 24 Mar 2024 01:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711243167; cv=none; b=hZFdNnRQJhC3l/uiYi7RlaDIAW5cSGEBrtWRThlp1ZeSKx3ri3BQngT84rp6PBvdgLIo102TEz2FWFYW8W+3wg6MuWOkMxcTRWNUSErgCc7T88Ggr1Yi35Lxgr9rL7j3HSNeh8AI9s6+YiTZ+be0bM7i5jbqRr/uJoP99G2PMCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711243167; c=relaxed/simple; bh=TSFL6ZPHf+nNmZN+mCrQRVmu2K+uA7T8UTvuYZPSASo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=s596kTSZrUN7st/aGBg2mS06oX1HH1w3T3+dB3F0rpPaYvB0DNmIyszV/eo5Wc5OgrMPTFAm8hdRw31G7B/4bE/If/U8NDCS+ZTwHc0PIehkAw+Ju1cRBKG2CKSJJIeN+oAjdFuQr9ssM4P+37egpUMqVYS1ut74C/KPd2oEfz4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=rRDXvXuP; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="rRDXvXuP" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description; bh=wi2LTI5KP53CdNiOrYDHD4tTYnyBEg2RipTULkJ4IRM=; b=rRDXvXuPpC8yTHiw6Pqb7l8czJ zIS6KU5zxoaXKjRcqGyLnpkLYImkubIoRFPG5QJ02jpARz/K3nbOr59QomAZ1P9+nUjEqiTaMnHVu c7sb8Cm4ZOZvUdTyLln6Z91fC8snZ4LzvbEoUjPZCN8HBibknob1cCH1HxUm2WIk0cpY4FdneTzHT 78xVgCpjpXN2NylIxDbMIBQYkwUvKoe5H9/JL3Qp+unVfmpRq/66fh2oGpxMGB9d8nlmzwxQMgEwV wDxkzlQzgEEKroY0OdUSobaLKpnaqBCWefobPw8oMvwK7yJSbArxJxEf8SND1DmGwvaiZB/c3TfXg TLFJIzEg==; Received: from fpd2fa7e2a.ap.nuro.jp ([210.250.126.42] helo=[192.168.1.8]) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1roCW4-0000000Cwtk-1hTK; Sun, 24 Mar 2024 01:19:16 +0000 Message-ID: <63e4017f-dcdd-4c28-9591-1ce7f0e9b761@infradead.org> Date: Sun, 24 Mar 2024 10:19:06 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] powerpc: ps3: mark ps3_notification_device static for stack usage Content-Language: en-US To: Arnd Bergmann , Geert Uytterhoeven , Arnd Bergmann Cc: llvm@lists.linux.dev, Kevin Hao , "Aneesh Kumar K.V" , Nick Desaulniers , linux-kernel@vger.kernel.org, Nathan Chancellor , Nicholas Piggin , Justin Stitt , "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org, Bill Wendling References: <20240320180333.151043-1-arnd@kernel.org> <87f6365f-a40e-4606-baff-170cb8fc48f3@infradead.org> <7f854130-e92f-488f-9c56-a65f86b95567@app.fastmail.com> From: Geoff Levand In-Reply-To: <7f854130-e92f-488f-9c56-a65f86b95567@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 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