From: David Sterba <dsterba@suse.cz>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
Johannes Thumshirn <jthumshirn@suse.de>,
Nikolay Borisov <nborisov@suse.com>,
Andrea Gelmini <andrea.gelmini@gelma.net>,
Qu Wenruo <wqu@suse.com>, Liu Bo <bo.liu@linux.alibaba.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: reduce stack usage for btrfsic_process_written_block
Date: Wed, 24 Jul 2019 16:57:26 +0200 [thread overview]
Message-ID: <20190724145726.GP2868@twin.jikos.cz> (raw)
In-Reply-To: <20190708124019.3374246-1-arnd@arndb.de>
On Mon, Jul 08, 2019 at 02:40:09PM +0200, Arnd Bergmann wrote:
> btrfsic_process_written_block() cals btrfsic_process_metablock(),
> which has a fairly large stack usage due to the btrfsic_stack_frame
> variable. It also calls btrfsic_test_for_metadata(), which now
> needs several hundreds of bytes for its SHASH_DESC_ON_STACK().
>
> In some configurations, we end up with both functions on the
> same stack, and gcc warns about the excessive stack usage that
> might cause the available stack space to run out:
>
> fs/btrfs/check-integrity.c:1743:13: error: stack frame size of 1152 bytes in function 'btrfsic_process_written_block' [-Werror,-Wframe-larger-than=]
>
> Marking both child functions as noinline_for_stack helps because
> this guarantees that the large variables are not on the same
> stack frame.
>
> Fixes: d5178578bcd4 ("btrfs: directly call into crypto framework for checksumming")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Added to misc-next, thanks.
prev parent reply other threads:[~2019-07-24 14:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-08 12:40 [PATCH] btrfs: reduce stack usage for btrfsic_process_written_block Arnd Bergmann
2019-07-08 12:47 ` Johannes Thumshirn
2019-07-24 14:57 ` David Sterba [this message]
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=20190724145726.GP2868@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=andrea.gelmini@gelma.net \
--cc=arnd@arndb.de \
--cc=bo.liu@linux.alibaba.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=jthumshirn@suse.de \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=wqu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox