llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Harry Wentland <harry.wentland@amd.com>
Cc: "amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"xinhui pan" <Xinhui.Pan@amd.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Guenter Roeck" <linux@roeck-us.net>,
	llvm@lists.linux.dev
Subject: Re: [PATCH] drm/amd/display: Reduce stack size for dml21_ModeSupportAndSystemConfigurationFull
Date: Tue, 14 Sep 2021 23:56:11 +0200	[thread overview]
Message-ID: <CAK8P3a243ruO-7H79yZ49_+5RVQk4V7kE_=Ffy7Gko-um_0VBA@mail.gmail.com> (raw)
In-Reply-To: <20210914210508.10627-1-harry.wentland@amd.com>

On Tue, Sep 14, 2021 at 11:05 PM Harry Wentland <harry.wentland@amd.com> wrote:
>
> [Why & How]
> With Werror enabled in the kernel we were failing the clang build since
> dml21_ModeSupportAndSystemConfigurationFull's stack frame is 1064 when
> building with clang, and exceeding the default 1024 stack frame limit.
>
> The culprit seems to be the Pipe struct, so pull the relevant block
> out into its own sub-function.

I suspect it's not the Pipe struct but rather the way that you call another
function with a crazy number of arguments here. After your change,
this likely gets inlined and you avoid the problem, so the patch ends
up doing the right thing.

If you do more patches like this, I would suggest mentioning the new
stack usage of the calling function and the new noinline function, to
make sure that the combined number isn't actually worse than the old
number.

You can get these numbers by recompiling the file with the frame
size warning set to a low value, e.g. adding -Wframe-larger-than=100
to the command line.

Acked-by: Arnd Bergmann <arnd@arndb.de>

  reply	other threads:[~2021-09-14 21:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 21:05 [PATCH] drm/amd/display: Reduce stack size for dml21_ModeSupportAndSystemConfigurationFull Harry Wentland
2021-09-14 21:56 ` Arnd Bergmann [this message]
2021-09-16 14:34 ` Leo Li

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='CAK8P3a243ruO-7H79yZ49_+5RVQk4V7kE_=Ffy7Gko-um_0VBA@mail.gmail.com' \
    --to=arnd@kernel.org \
    --cc=Xinhui.Pan@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=sunpeng.li@amd.com \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).