lkml.org 
[lkml]   [2019]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] btrfs: reduce stack usage for btrfsic_process_written_block
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.

\
 
 \ /
  Last update: 2019-07-24 16:57    [W:0.104 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site