The kbuild test project found an oversized stack frame in rcu_gp_kthread() for some kernel configurations. This oversizing was due to a very large amount of inlining, which is unnecessary due to the fact that this code executes infrequently. This commit therefore marks rcu_gp_init() and rcu_gp_fqs_loop noinline_for_stack to conserve stack space.
Unified · Split
| @@ -1733,7 +1733,7 @@ static void rcu_strict_gp_boundary(void *unused) · 1732 unmodified lines | |||
| 1733 | /* | 1733 | /* |
| 1734 | * Initialize a new grace period. Return false if no grace period required. | 1734 | * Initialize a new grace period. Return false if no grace period required. |
| 1735 | */ | 1735 | */ |
| 1736 | static bool rcu_gp_init(void) | 1736 | static noinline_for_stack bool rcu_gp_init(void) |
| 1737 | { | 1737 | { |
| 1738 | unsigned long firstseq; | 1738 | unsigned long firstseq; |
| 1739 | unsigned long flags; | 1739 | unsigned long flags; |
| @@ -1927,7 +1927,7 @@ static void rcu_gp_fqs(bool first_time) · 187 unmodified lines | |||
| 1927 | /* | 1927 | /* |
| 1928 | * Loop doing repeated quiescent-state forcing until the grace period ends. | 1928 | * Loop doing repeated quiescent-state forcing until the grace period ends. |
| 1929 | */ | 1929 | */ |
| 1930 | static void rcu_gp_fqs_loop(void) | 1930 | static noinline_for_stack void rcu_gp_fqs_loop(void) |
| 1931 | { | 1931 | { |
| 1932 | bool first_gp_fqs; | 1932 | bool first_gp_fqs; |
| 1933 | int gf = 0; | 1933 | int gf = 0; |