From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Mark Brown <broonie@kernel.org>,
Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: yung-chuan.liao@linux.intel.com, lgirdwood@gmail.com,
alsa-devel@alsa-project.org, patches@opensource.cirrus.com
Subject: Re: [PATCH] ASoC: soc-pcm: Shrink stack frame for __soc_pcm_hw_params
Date: Wed, 23 Aug 2023 11:26:12 -0500 [thread overview]
Message-ID: <797d83be-feaf-04ec-9be6-9343d2ab3a33@linux.intel.com> (raw)
In-Reply-To: <df2be4c7-f3ae-41dc-b2c2-3128a1ecc684@sirena.org.uk>
On 8/23/23 11:19, Mark Brown wrote:
> On Wed, Aug 23, 2023 at 03:49:58PM +0000, Charles Keepax wrote:
>> On Wed, Aug 23, 2023 at 10:21:13AM +0100, Charles Keepax wrote:
>>> Commit ac950278b087 ("ASoC: add N cpus to M codecs dai link support")
>>> added an additional local params in __soc_pmc_hw_params, for the
>>> CPU side of the DAI. The snd_pcm_hw_params struct is pretty large (604
>>> bytes) and keeping two local copies of it makes the stack frame for
>>> __soc_pcm_hw_params really large. As the two copies are only used
>>> sequentially combine these into a single local variable to shrink the
>>> stack frame.
>
>> Hmm... this might need a little more thought its not clear why this
>> should change the frame size and it only seems to change the frame
>> size on the ARM cross compiler I am using, not x86.
>
> Isn't that just going to be a function of the compiler being smart
> enough to work out that there aren't overlapping uses of the two
> variables and they can share stack space? There's no reason not to help
> it figure that out.
One would think that compilers understand the variable scope, and
free-up the stack when leaving a for loop scope?
next prev parent reply other threads:[~2023-08-23 16:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 9:21 [PATCH] ASoC: soc-pcm: Shrink stack frame for __soc_pcm_hw_params Charles Keepax
2023-08-23 15:49 ` Charles Keepax
2023-08-23 16:19 ` Mark Brown
2023-08-23 16:26 ` Pierre-Louis Bossart [this message]
2023-08-23 16:39 ` Mark Brown
2023-08-23 16:39 ` Charles Keepax
2023-08-24 9:33 ` Charles Keepax
2023-08-24 14:43 ` Pierre-Louis Bossart
2023-09-11 15:07 ` Mark Brown
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=797d83be-feaf-04ec-9be6-9343d2ab3a33@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=patches@opensource.cirrus.com \
--cc=yung-chuan.liao@linux.intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.