linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
@ 2021-06-06  4:19 kernel test robot
  2021-06-06  4:49 ` Paul E. McKenney
  0 siblings, 1 reply; 11+ messages in thread
From: kernel test robot @ 2021-06-06  4:19 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: kbuild-all, clang-built-linux, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 6250 bytes --]

Hi Paul,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
date:   5 months ago
config: powerpc-randconfig-r023-20210606 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from kernel/rcu/tree.c:21:
   In file included from include/linux/kernel.h:12:
   In file included from include/linux/bitops.h:29:
   In file included from arch/powerpc/include/asm/bitops.h:62:
   arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
   #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
           ^
   <built-in>:310:9: note: previous definition is here
   #define __lwsync __builtin_ppc_lwsync
           ^
>> kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
   static int __noreturn rcu_gp_kthread(void *unused)
                         ^
   2 warnings generated.


vim +/rcu_gp_kthread +2073 kernel/rcu/tree.c

7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2069  
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2070  /*
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2071   * Body of kthread that handles grace periods.
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2072   */
0854a05c9fa554 kernel/rcu/tree.c Paul E. McKenney 2018-07-03 @2073  static int __noreturn rcu_gp_kthread(void *unused)
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2074  {
5871968d531f39 kernel/rcu/tree.c Paul E. McKenney 2015-02-24  2075  	rcu_bind_gp_kthread();
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2076  	for (;;) {
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2077  
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2078  		/* Handle grace-period start. */
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2079  		for (;;) {
0f11ad323dd3d3 kernel/rcu/tree.c Paul E. McKenney 2020-02-10  2080  			trace_rcu_grace_period(rcu_state.name, rcu_state.gp_seq,
63c4db78e80407 kernel/rcutree.c  Paul E. McKenney 2013-08-09  2081  					       TPS("reqwait"));
9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2082  			rcu_state.gp_state = RCU_GP_WAIT_GPS;
9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2083  			swait_event_idle_exclusive(rcu_state.gp_wq,
9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2084  					 READ_ONCE(rcu_state.gp_flags) &
4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2085  					 RCU_GP_FLAG_INIT);
55b2dcf5870004 kernel/rcu/tree.c Paul E. McKenney 2020-04-01  2086  			rcu_gp_torture_wait();
9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2087  			rcu_state.gp_state = RCU_GP_DONE_GPS;
78e4bc34e5d966 kernel/rcu/tree.c Paul E. McKenney 2013-09-24  2088  			/* Locking provides needed memory barrier. */
0854a05c9fa554 kernel/rcu/tree.c Paul E. McKenney 2018-07-03  2089  			if (rcu_gp_init())
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2090  				break;
cee43939893337 kernel/rcu/tree.c Paul E. McKenney 2018-03-02  2091  			cond_resched_tasks_rcu_qs();
9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2092  			WRITE_ONCE(rcu_state.gp_activity, jiffies);
73a860cd58a1eb kernel/rcu/tree.c Paul E. McKenney 2014-08-14  2093  			WARN_ON(signal_pending(current));
0f11ad323dd3d3 kernel/rcu/tree.c Paul E. McKenney 2020-02-10  2094  			trace_rcu_grace_period(rcu_state.name, rcu_state.gp_seq,
63c4db78e80407 kernel/rcutree.c  Paul E. McKenney 2013-08-09  2095  					       TPS("reqwaitsig"));
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2096  		}
7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2097  
4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2098  		/* Handle quiescent-state forcing. */
c3854a055bc834 kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2099  		rcu_gp_fqs_loop();
4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2100  
4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2101  		/* Handle grace-period end. */
9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2102  		rcu_state.gp_state = RCU_GP_CLEANUP;
0854a05c9fa554 kernel/rcu/tree.c Paul E. McKenney 2018-07-03  2103  		rcu_gp_cleanup();
9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2104  		rcu_state.gp_state = RCU_GP_CLEANED;
4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2105  	}
b3dbec76e5334f kernel/rcutree.c  Paul E. McKenney 2012-06-18  2106  }
b3dbec76e5334f kernel/rcutree.c  Paul E. McKenney 2012-06-18  2107  

:::::: The code at line 2073 was first introduced by commit
:::::: 0854a05c9fa554930174f0fa7453c18f99108a4a rcu: Remove rsp parameter from rcu_gp_kthread() and friends

:::::: TO: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
:::::: CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25181 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-06  4:19 kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' kernel test robot
@ 2021-06-06  4:49 ` Paul E. McKenney
  2021-06-07  9:18   ` [kbuild-all] " Rong Chen
  0 siblings, 1 reply; 11+ messages in thread
From: Paul E. McKenney @ 2021-06-06  4:49 UTC (permalink / raw)
  To: kernel test robot; +Cc: kbuild-all, clang-built-linux, linux-kernel

On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
> Hi Paul,
> 
> FYI, the error/warning still remains.
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
> commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
> date:   5 months ago
> config: powerpc-randconfig-r023-20210606 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # install powerpc cross compiling tool for clang build
>         # apt-get install binutils-powerpc-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
>    In file included from kernel/rcu/tree.c:21:
>    In file included from include/linux/kernel.h:12:
>    In file included from include/linux/bitops.h:29:
>    In file included from arch/powerpc/include/asm/bitops.h:62:
>    arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
>    #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
>            ^
>    <built-in>:310:9: note: previous definition is here
>    #define __lwsync __builtin_ppc_lwsync
>            ^
> >> kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
>    static int __noreturn rcu_gp_kthread(void *unused)

Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
for tracing") help?

							Thanx, Paul

>    2 warnings generated.
> 
> 
> vim +/rcu_gp_kthread +2073 kernel/rcu/tree.c
> 
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2069  
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2070  /*
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2071   * Body of kthread that handles grace periods.
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2072   */
> 0854a05c9fa554 kernel/rcu/tree.c Paul E. McKenney 2018-07-03 @2073  static int __noreturn rcu_gp_kthread(void *unused)
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2074  {
> 5871968d531f39 kernel/rcu/tree.c Paul E. McKenney 2015-02-24  2075  	rcu_bind_gp_kthread();
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2076  	for (;;) {
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2077  
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2078  		/* Handle grace-period start. */
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2079  		for (;;) {
> 0f11ad323dd3d3 kernel/rcu/tree.c Paul E. McKenney 2020-02-10  2080  			trace_rcu_grace_period(rcu_state.name, rcu_state.gp_seq,
> 63c4db78e80407 kernel/rcutree.c  Paul E. McKenney 2013-08-09  2081  					       TPS("reqwait"));
> 9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2082  			rcu_state.gp_state = RCU_GP_WAIT_GPS;
> 9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2083  			swait_event_idle_exclusive(rcu_state.gp_wq,
> 9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2084  					 READ_ONCE(rcu_state.gp_flags) &
> 4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2085  					 RCU_GP_FLAG_INIT);
> 55b2dcf5870004 kernel/rcu/tree.c Paul E. McKenney 2020-04-01  2086  			rcu_gp_torture_wait();
> 9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2087  			rcu_state.gp_state = RCU_GP_DONE_GPS;
> 78e4bc34e5d966 kernel/rcu/tree.c Paul E. McKenney 2013-09-24  2088  			/* Locking provides needed memory barrier. */
> 0854a05c9fa554 kernel/rcu/tree.c Paul E. McKenney 2018-07-03  2089  			if (rcu_gp_init())
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2090  				break;
> cee43939893337 kernel/rcu/tree.c Paul E. McKenney 2018-03-02  2091  			cond_resched_tasks_rcu_qs();
> 9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2092  			WRITE_ONCE(rcu_state.gp_activity, jiffies);
> 73a860cd58a1eb kernel/rcu/tree.c Paul E. McKenney 2014-08-14  2093  			WARN_ON(signal_pending(current));
> 0f11ad323dd3d3 kernel/rcu/tree.c Paul E. McKenney 2020-02-10  2094  			trace_rcu_grace_period(rcu_state.name, rcu_state.gp_seq,
> 63c4db78e80407 kernel/rcutree.c  Paul E. McKenney 2013-08-09  2095  					       TPS("reqwaitsig"));
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2096  		}
> 7fdefc10e1d730 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2097  
> 4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2098  		/* Handle quiescent-state forcing. */
> c3854a055bc834 kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2099  		rcu_gp_fqs_loop();
> 4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2100  
> 4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2101  		/* Handle grace-period end. */
> 9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2102  		rcu_state.gp_state = RCU_GP_CLEANUP;
> 0854a05c9fa554 kernel/rcu/tree.c Paul E. McKenney 2018-07-03  2103  		rcu_gp_cleanup();
> 9cbc5b97029bff kernel/rcu/tree.c Paul E. McKenney 2018-07-05  2104  		rcu_state.gp_state = RCU_GP_CLEANED;
> 4cdfc175c25c89 kernel/rcutree.c  Paul E. McKenney 2012-06-22  2105  	}
> b3dbec76e5334f kernel/rcutree.c  Paul E. McKenney 2012-06-18  2106  }
> b3dbec76e5334f kernel/rcutree.c  Paul E. McKenney 2012-06-18  2107  
> 
> :::::: The code at line 2073 was first introduced by commit
> :::::: 0854a05c9fa554930174f0fa7453c18f99108a4a rcu: Remove rsp parameter from rcu_gp_kthread() and friends
> 
> :::::: TO: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> :::::: CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-06  4:49 ` Paul E. McKenney
@ 2021-06-07  9:18   ` Rong Chen
  2021-06-07 15:19     ` Paul E. McKenney
  0 siblings, 1 reply; 11+ messages in thread
From: Rong Chen @ 2021-06-07  9:18 UTC (permalink / raw)
  To: paulmck, kernel test robot; +Cc: kbuild-all, clang-built-linux, linux-kernel



On 6/6/21 12:49 PM, Paul E. McKenney wrote:
> On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
>> Hi Paul,
>>
>> FYI, the error/warning still remains.
>>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
>> commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
>> date:   5 months ago
>> config: powerpc-randconfig-r023-20210606 (attached as .config)
>> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
>> reproduce (this is a W=1 build):
>>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>          chmod +x ~/bin/make.cross
>>          # install powerpc cross compiling tool for clang build
>>          # apt-get install binutils-powerpc-linux-gnu
>>          # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
>>          git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>          git fetch --no-tags linus master
>>          git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
>>          # save the attached .config to linux build tree
>>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All warnings (new ones prefixed by >>):
>>
>>     In file included from kernel/rcu/tree.c:21:
>>     In file included from include/linux/kernel.h:12:
>>     In file included from include/linux/bitops.h:29:
>>     In file included from arch/powerpc/include/asm/bitops.h:62:
>>     arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
>>     #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
>>             ^
>>     <built-in>:310:9: note: previous definition is here
>>     #define __lwsync __builtin_ppc_lwsync
>>             ^
>>>> kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
>>     static int __noreturn rcu_gp_kthread(void *unused)
> Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
> for tracing") help?

Hi Paul,

The stack frame size decreased to 2256 bytes:

   kernel/rcu/tree.c:2129:23: warning: stack frame size of 2256 bytes in 
function 'rcu_gp_kthread' [-Wframe-larger-than=]

Best Regards,
Rong Chen

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-07  9:18   ` [kbuild-all] " Rong Chen
@ 2021-06-07 15:19     ` Paul E. McKenney
  2021-06-08  3:14       ` Rong Chen
  0 siblings, 1 reply; 11+ messages in thread
From: Paul E. McKenney @ 2021-06-07 15:19 UTC (permalink / raw)
  To: Rong Chen; +Cc: kernel test robot, kbuild-all, clang-built-linux, linux-kernel

On Mon, Jun 07, 2021 at 05:18:21PM +0800, Rong Chen wrote:
> 
> 
> On 6/6/21 12:49 PM, Paul E. McKenney wrote:
> > On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
> > > Hi Paul,
> > > 
> > > FYI, the error/warning still remains.
> > > 
> > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > > head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
> > > commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
> > > date:   5 months ago
> > > config: powerpc-randconfig-r023-20210606 (attached as .config)
> > > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
> > > reproduce (this is a W=1 build):
> > >          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > >          chmod +x ~/bin/make.cross
> > >          # install powerpc cross compiling tool for clang build
> > >          # apt-get install binutils-powerpc-linux-gnu
> > >          # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
> > >          git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > >          git fetch --no-tags linus master
> > >          git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
> > >          # save the attached .config to linux build tree
> > >          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
> > > 
> > > If you fix the issue, kindly add following tag as appropriate
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > 
> > > All warnings (new ones prefixed by >>):
> > > 
> > >     In file included from kernel/rcu/tree.c:21:
> > >     In file included from include/linux/kernel.h:12:
> > >     In file included from include/linux/bitops.h:29:
> > >     In file included from arch/powerpc/include/asm/bitops.h:62:
> > >     arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
> > >     #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
> > >             ^
> > >     <built-in>:310:9: note: previous definition is here
> > >     #define __lwsync __builtin_ppc_lwsync
> > >             ^
> > > > > kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
> > >     static int __noreturn rcu_gp_kthread(void *unused)
> > Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
> > for tracing") help?
> 
> Hi Paul,
> 
> The stack frame size decreased to 2256 bytes:
> 
>   kernel/rcu/tree.c:2129:23: warning: stack frame size of 2256 bytes in
> function 'rcu_gp_kthread' [-Wframe-larger-than=]

Very good, thank you!  Does the following patch (in addition to that
commit) also help?

							Thanx, Paul

------------------------------------------------------------------------

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 13bd8eee62bf..ef435aeac993 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
 /*
  * Initialize a new grace period.  Return false if no grace period required.
  */
-static bool rcu_gp_init(void)
+static noinline bool rcu_gp_init(void)
 {
 	unsigned long firstseq;
 	unsigned long flags;
@@ -1931,7 +1931,7 @@ static void rcu_gp_fqs(bool first_time)
 /*
  * Loop doing repeated quiescent-state forcing until the grace period ends.
  */
-static void rcu_gp_fqs_loop(void)
+static noinline void rcu_gp_fqs_loop(void)
 {
 	bool first_gp_fqs;
 	int gf = 0;

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-07 15:19     ` Paul E. McKenney
@ 2021-06-08  3:14       ` Rong Chen
  2021-06-08  5:01         ` Paul E. McKenney
  0 siblings, 1 reply; 11+ messages in thread
From: Rong Chen @ 2021-06-08  3:14 UTC (permalink / raw)
  To: paulmck; +Cc: kernel test robot, kbuild-all, clang-built-linux, linux-kernel



On 6/7/21 11:19 PM, Paul E. McKenney wrote:
> On Mon, Jun 07, 2021 at 05:18:21PM +0800, Rong Chen wrote:
>>
>> On 6/6/21 12:49 PM, Paul E. McKenney wrote:
>>> On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
>>>> Hi Paul,
>>>>
>>>> FYI, the error/warning still remains.
>>>>
>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>> head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
>>>> commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
>>>> date:   5 months ago
>>>> config: powerpc-randconfig-r023-20210606 (attached as .config)
>>>> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
>>>> reproduce (this is a W=1 build):
>>>>           wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>>           chmod +x ~/bin/make.cross
>>>>           # install powerpc cross compiling tool for clang build
>>>>           # apt-get install binutils-powerpc-linux-gnu
>>>>           # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
>>>>           git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>>>           git fetch --no-tags linus master
>>>>           git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
>>>>           # save the attached .config to linux build tree
>>>>           COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
>>>>
>>>> If you fix the issue, kindly add following tag as appropriate
>>>> Reported-by: kernel test robot <lkp@intel.com>
>>>>
>>>> All warnings (new ones prefixed by >>):
>>>>
>>>>      In file included from kernel/rcu/tree.c:21:
>>>>      In file included from include/linux/kernel.h:12:
>>>>      In file included from include/linux/bitops.h:29:
>>>>      In file included from arch/powerpc/include/asm/bitops.h:62:
>>>>      arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
>>>>      #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
>>>>              ^
>>>>      <built-in>:310:9: note: previous definition is here
>>>>      #define __lwsync __builtin_ppc_lwsync
>>>>              ^
>>>>>> kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
>>>>      static int __noreturn rcu_gp_kthread(void *unused)
>>> Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
>>> for tracing") help?
>> Hi Paul,
>>
>> The stack frame size decreased to 2256 bytes:
>>
>>    kernel/rcu/tree.c:2129:23: warning: stack frame size of 2256 bytes in
>> function 'rcu_gp_kthread' [-Wframe-larger-than=]
> Very good, thank you!  Does the following patch (in addition to that
> commit) also help?

Hi Paul,

I applied the below patch on commit 2f20de99a63b and the warning is gone.

Best Regards,
Rong Chen

>
> 							Thanx, Paul
>
> ------------------------------------------------------------------------
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 13bd8eee62bf..ef435aeac993 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
>   /*
>    * Initialize a new grace period.  Return false if no grace period required.
>    */
> -static bool rcu_gp_init(void)
> +static noinline bool rcu_gp_init(void)
>   {
>   	unsigned long firstseq;
>   	unsigned long flags;
> @@ -1931,7 +1931,7 @@ static void rcu_gp_fqs(bool first_time)
>   /*
>    * Loop doing repeated quiescent-state forcing until the grace period ends.
>    */
> -static void rcu_gp_fqs_loop(void)
> +static noinline void rcu_gp_fqs_loop(void)
>   {
>   	bool first_gp_fqs;
>   	int gf = 0;


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-08  3:14       ` Rong Chen
@ 2021-06-08  5:01         ` Paul E. McKenney
  2021-06-08  5:34           ` Rong Chen
  2021-06-08 15:53           ` Nathan Chancellor
  0 siblings, 2 replies; 11+ messages in thread
From: Paul E. McKenney @ 2021-06-08  5:01 UTC (permalink / raw)
  To: Rong Chen; +Cc: kernel test robot, kbuild-all, clang-built-linux, linux-kernel

On Tue, Jun 08, 2021 at 11:14:40AM +0800, Rong Chen wrote:
> 
> 
> On 6/7/21 11:19 PM, Paul E. McKenney wrote:
> > On Mon, Jun 07, 2021 at 05:18:21PM +0800, Rong Chen wrote:
> > > 
> > > On 6/6/21 12:49 PM, Paul E. McKenney wrote:
> > > > On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
> > > > > Hi Paul,
> > > > > 
> > > > > FYI, the error/warning still remains.
> > > > > 
> > > > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > > > > head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
> > > > > commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
> > > > > date:   5 months ago
> > > > > config: powerpc-randconfig-r023-20210606 (attached as .config)
> > > > > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
> > > > > reproduce (this is a W=1 build):
> > > > >           wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > > > >           chmod +x ~/bin/make.cross
> > > > >           # install powerpc cross compiling tool for clang build
> > > > >           # apt-get install binutils-powerpc-linux-gnu
> > > > >           # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
> > > > >           git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > > >           git fetch --no-tags linus master
> > > > >           git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
> > > > >           # save the attached .config to linux build tree
> > > > >           COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
> > > > > 
> > > > > If you fix the issue, kindly add following tag as appropriate
> > > > > Reported-by: kernel test robot <lkp@intel.com>
> > > > > 
> > > > > All warnings (new ones prefixed by >>):
> > > > > 
> > > > >      In file included from kernel/rcu/tree.c:21:
> > > > >      In file included from include/linux/kernel.h:12:
> > > > >      In file included from include/linux/bitops.h:29:
> > > > >      In file included from arch/powerpc/include/asm/bitops.h:62:
> > > > >      arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
> > > > >      #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
> > > > >              ^
> > > > >      <built-in>:310:9: note: previous definition is here
> > > > >      #define __lwsync __builtin_ppc_lwsync
> > > > >              ^
> > > > > > > kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
> > > > >      static int __noreturn rcu_gp_kthread(void *unused)
> > > > Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
> > > > for tracing") help?
> > > Hi Paul,
> > > 
> > > The stack frame size decreased to 2256 bytes:
> > > 
> > >    kernel/rcu/tree.c:2129:23: warning: stack frame size of 2256 bytes in
> > > function 'rcu_gp_kthread' [-Wframe-larger-than=]
> > Very good, thank you!  Does the following patch (in addition to that
> > commit) also help?
> 
> Hi Paul,
> 
> I applied the below patch on commit 2f20de99a63b and the warning is gone.

Very good, and thank you for your testing.  I have applied the requested
Reported-by and your Tested-by on the commit shown below.  Please let
me know if you would prefer some other Reported/Tested setup.

							Thanx, Paul

------------------------------------------------------------------------

commit 336e92638287615d47c07af4ff6feb397cfe2084
Author: Paul E. McKenney <paulmck@kernel.org>
Date:   Mon Jun 7 21:57:02 2021 -0700

    rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack
    
    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 to conserve stack space.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Tested-by: Rong Chen <rong.a.chen@intel.com>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 13bd8eee62bf..ef435aeac993 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
 /*
  * Initialize a new grace period.  Return false if no grace period required.
  */
-static bool rcu_gp_init(void)
+static noinline bool rcu_gp_init(void)
 {
 	unsigned long firstseq;
 	unsigned long flags;
@@ -1931,7 +1931,7 @@ static void rcu_gp_fqs(bool first_time)
 /*
  * Loop doing repeated quiescent-state forcing until the grace period ends.
  */
-static void rcu_gp_fqs_loop(void)
+static noinline void rcu_gp_fqs_loop(void)
 {
 	bool first_gp_fqs;
 	int gf = 0;

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-08  5:01         ` Paul E. McKenney
@ 2021-06-08  5:34           ` Rong Chen
  2021-06-08 15:53           ` Nathan Chancellor
  1 sibling, 0 replies; 11+ messages in thread
From: Rong Chen @ 2021-06-08  5:34 UTC (permalink / raw)
  To: paulmck; +Cc: kernel test robot, kbuild-all, clang-built-linux, linux-kernel



On 6/8/21 1:01 PM, Paul E. McKenney wrote:
> On Tue, Jun 08, 2021 at 11:14:40AM +0800, Rong Chen wrote:
>>
>> On 6/7/21 11:19 PM, Paul E. McKenney wrote:
>>> On Mon, Jun 07, 2021 at 05:18:21PM +0800, Rong Chen wrote:
>>>> On 6/6/21 12:49 PM, Paul E. McKenney wrote:
>>>>> On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
>>>>>> Hi Paul,
>>>>>>
>>>>>> FYI, the error/warning still remains.
>>>>>>
>>>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>>>> head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
>>>>>> commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
>>>>>> date:   5 months ago
>>>>>> config: powerpc-randconfig-r023-20210606 (attached as .config)
>>>>>> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
>>>>>> reproduce (this is a W=1 build):
>>>>>>            wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>>>>            chmod +x ~/bin/make.cross
>>>>>>            # install powerpc cross compiling tool for clang build
>>>>>>            # apt-get install binutils-powerpc-linux-gnu
>>>>>>            # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
>>>>>>            git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>>>>>            git fetch --no-tags linus master
>>>>>>            git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
>>>>>>            # save the attached .config to linux build tree
>>>>>>            COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
>>>>>>
>>>>>> If you fix the issue, kindly add following tag as appropriate
>>>>>> Reported-by: kernel test robot <lkp@intel.com>
>>>>>>
>>>>>> All warnings (new ones prefixed by >>):
>>>>>>
>>>>>>       In file included from kernel/rcu/tree.c:21:
>>>>>>       In file included from include/linux/kernel.h:12:
>>>>>>       In file included from include/linux/bitops.h:29:
>>>>>>       In file included from arch/powerpc/include/asm/bitops.h:62:
>>>>>>       arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
>>>>>>       #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
>>>>>>               ^
>>>>>>       <built-in>:310:9: note: previous definition is here
>>>>>>       #define __lwsync __builtin_ppc_lwsync
>>>>>>               ^
>>>>>>>> kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
>>>>>>       static int __noreturn rcu_gp_kthread(void *unused)
>>>>> Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
>>>>> for tracing") help?
>>>> Hi Paul,
>>>>
>>>> The stack frame size decreased to 2256 bytes:
>>>>
>>>>     kernel/rcu/tree.c:2129:23: warning: stack frame size of 2256 bytes in
>>>> function 'rcu_gp_kthread' [-Wframe-larger-than=]
>>> Very good, thank you!  Does the following patch (in addition to that
>>> commit) also help?
>> Hi Paul,
>>
>> I applied the below patch on commit 2f20de99a63b and the warning is gone.
> Very good, and thank you for your testing.  I have applied the requested
> Reported-by and your Tested-by on the commit shown below.  Please let
> me know if you would prefer some other Reported/Tested setup.
>
> 							Thanx, Paul

Hi Paul,

Thanks for your trust, it looks fine.

Best Regards,
Rong Chen


>
> ------------------------------------------------------------------------
>
> commit 336e92638287615d47c07af4ff6feb397cfe2084
> Author: Paul E. McKenney <paulmck@kernel.org>
> Date:   Mon Jun 7 21:57:02 2021 -0700
>
>      rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack
>      
>      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 to conserve stack space.
>      
>      Reported-by: kernel test robot <lkp@intel.com>
>      Tested-by: Rong Chen <rong.a.chen@intel.com>
>      Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 13bd8eee62bf..ef435aeac993 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
>   /*
>    * Initialize a new grace period.  Return false if no grace period required.
>    */
> -static bool rcu_gp_init(void)
> +static noinline bool rcu_gp_init(void)
>   {
>   	unsigned long firstseq;
>   	unsigned long flags;
> @@ -1931,7 +1931,7 @@ static void rcu_gp_fqs(bool first_time)
>   /*
>    * Loop doing repeated quiescent-state forcing until the grace period ends.
>    */
> -static void rcu_gp_fqs_loop(void)
> +static noinline void rcu_gp_fqs_loop(void)
>   {
>   	bool first_gp_fqs;
>   	int gf = 0;


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-08  5:01         ` Paul E. McKenney
  2021-06-08  5:34           ` Rong Chen
@ 2021-06-08 15:53           ` Nathan Chancellor
  2021-06-09  3:58             ` Paul E. McKenney
  1 sibling, 1 reply; 11+ messages in thread
From: Nathan Chancellor @ 2021-06-08 15:53 UTC (permalink / raw)
  To: paulmck, Rong Chen
  Cc: kernel test robot, kbuild-all, clang-built-linux, linux-kernel

On 6/7/2021 10:01 PM, Paul E. McKenney wrote:
> On Tue, Jun 08, 2021 at 11:14:40AM +0800, Rong Chen wrote:
>>
>>
>> On 6/7/21 11:19 PM, Paul E. McKenney wrote:
>>> On Mon, Jun 07, 2021 at 05:18:21PM +0800, Rong Chen wrote:
>>>>
>>>> On 6/6/21 12:49 PM, Paul E. McKenney wrote:
>>>>> On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
>>>>>> Hi Paul,
>>>>>>
>>>>>> FYI, the error/warning still remains.
>>>>>>
>>>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>>>> head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
>>>>>> commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
>>>>>> date:   5 months ago
>>>>>> config: powerpc-randconfig-r023-20210606 (attached as .config)
>>>>>> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
>>>>>> reproduce (this is a W=1 build):
>>>>>>            wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>>>>            chmod +x ~/bin/make.cross
>>>>>>            # install powerpc cross compiling tool for clang build
>>>>>>            # apt-get install binutils-powerpc-linux-gnu
>>>>>>            # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
>>>>>>            git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>>>>>            git fetch --no-tags linus master
>>>>>>            git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
>>>>>>            # save the attached .config to linux build tree
>>>>>>            COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
>>>>>>
>>>>>> If you fix the issue, kindly add following tag as appropriate
>>>>>> Reported-by: kernel test robot <lkp@intel.com>
>>>>>>
>>>>>> All warnings (new ones prefixed by >>):
>>>>>>
>>>>>>       In file included from kernel/rcu/tree.c:21:
>>>>>>       In file included from include/linux/kernel.h:12:
>>>>>>       In file included from include/linux/bitops.h:29:
>>>>>>       In file included from arch/powerpc/include/asm/bitops.h:62:
>>>>>>       arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
>>>>>>       #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
>>>>>>               ^
>>>>>>       <built-in>:310:9: note: previous definition is here
>>>>>>       #define __lwsync __builtin_ppc_lwsync
>>>>>>               ^
>>>>>>>> kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
>>>>>>       static int __noreturn rcu_gp_kthread(void *unused)
>>>>> Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
>>>>> for tracing") help?
>>>> Hi Paul,
>>>>
>>>> The stack frame size decreased to 2256 bytes:
>>>>
>>>>     kernel/rcu/tree.c:2129:23: warning: stack frame size of 2256 bytes in
>>>> function 'rcu_gp_kthread' [-Wframe-larger-than=]
>>> Very good, thank you!  Does the following patch (in addition to that
>>> commit) also help?
>>
>> Hi Paul,
>>
>> I applied the below patch on commit 2f20de99a63b and the warning is gone.
> 
> Very good, and thank you for your testing.  I have applied the requested
> Reported-by and your Tested-by on the commit shown below.  Please let
> me know if you would prefer some other Reported/Tested setup.
> 
> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> commit 336e92638287615d47c07af4ff6feb397cfe2084
> Author: Paul E. McKenney <paulmck@kernel.org>
> Date:   Mon Jun 7 21:57:02 2021 -0700
> 
>      rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack
>      
>      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 to conserve stack space.
>      
>      Reported-by: kernel test robot <lkp@intel.com>
>      Tested-by: Rong Chen <rong.a.chen@intel.com>
>      Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 13bd8eee62bf..ef435aeac993 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
>   /*
>    * Initialize a new grace period.  Return false if no grace period required.
>    */
> -static bool rcu_gp_init(void)
> +static noinline bool rcu_gp_init(void)

Small comment if it is not too late. noinline_for_stack expands to the 
same thing but is self documenting :) that way people do not have to git 
blame to see why these are marked as noinline (not that too many people 
are probably touching this but still).

>   {
>   	unsigned long firstseq;
>   	unsigned long flags;
> @@ -1931,7 +1931,7 @@ static void rcu_gp_fqs(bool first_time)
>   /*
>    * Loop doing repeated quiescent-state forcing until the grace period ends.
>    */
> -static void rcu_gp_fqs_loop(void)
> +static noinline void rcu_gp_fqs_loop(void)
>   {
>   	bool first_gp_fqs;
>   	int gf = 0;
> 

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-08 15:53           ` Nathan Chancellor
@ 2021-06-09  3:58             ` Paul E. McKenney
  2021-06-09  4:14               ` Nathan Chancellor
  0 siblings, 1 reply; 11+ messages in thread
From: Paul E. McKenney @ 2021-06-09  3:58 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Rong Chen, kernel test robot, kbuild-all, clang-built-linux,
	linux-kernel

On Tue, Jun 08, 2021 at 08:53:17AM -0700, Nathan Chancellor wrote:
> On 6/7/2021 10:01 PM, Paul E. McKenney wrote:
> > On Tue, Jun 08, 2021 at 11:14:40AM +0800, Rong Chen wrote:
> > > 
> > > 
> > > On 6/7/21 11:19 PM, Paul E. McKenney wrote:
> > > > On Mon, Jun 07, 2021 at 05:18:21PM +0800, Rong Chen wrote:
> > > > > 
> > > > > On 6/6/21 12:49 PM, Paul E. McKenney wrote:
> > > > > > On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
> > > > > > > Hi Paul,
> > > > > > > 
> > > > > > > FYI, the error/warning still remains.
> > > > > > > 
> > > > > > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > > > > > > head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
> > > > > > > commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
> > > > > > > date:   5 months ago
> > > > > > > config: powerpc-randconfig-r023-20210606 (attached as .config)
> > > > > > > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
> > > > > > > reproduce (this is a W=1 build):
> > > > > > >            wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > > > > > >            chmod +x ~/bin/make.cross
> > > > > > >            # install powerpc cross compiling tool for clang build
> > > > > > >            # apt-get install binutils-powerpc-linux-gnu
> > > > > > >            # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
> > > > > > >            git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > > > > >            git fetch --no-tags linus master
> > > > > > >            git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
> > > > > > >            # save the attached .config to linux build tree
> > > > > > >            COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
> > > > > > > 
> > > > > > > If you fix the issue, kindly add following tag as appropriate
> > > > > > > Reported-by: kernel test robot <lkp@intel.com>
> > > > > > > 
> > > > > > > All warnings (new ones prefixed by >>):
> > > > > > > 
> > > > > > >       In file included from kernel/rcu/tree.c:21:
> > > > > > >       In file included from include/linux/kernel.h:12:
> > > > > > >       In file included from include/linux/bitops.h:29:
> > > > > > >       In file included from arch/powerpc/include/asm/bitops.h:62:
> > > > > > >       arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
> > > > > > >       #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
> > > > > > >               ^
> > > > > > >       <built-in>:310:9: note: previous definition is here
> > > > > > >       #define __lwsync __builtin_ppc_lwsync
> > > > > > >               ^
> > > > > > > > > kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
> > > > > > >       static int __noreturn rcu_gp_kthread(void *unused)
> > > > > > Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
> > > > > > for tracing") help?
> > > > > Hi Paul,
> > > > > 
> > > > > The stack frame size decreased to 2256 bytes:
> > > > > 
> > > > >     kernel/rcu/tree.c:2129:23: warning: stack frame size of 2256 bytes in
> > > > > function 'rcu_gp_kthread' [-Wframe-larger-than=]
> > > > Very good, thank you!  Does the following patch (in addition to that
> > > > commit) also help?
> > > 
> > > Hi Paul,
> > > 
> > > I applied the below patch on commit 2f20de99a63b and the warning is gone.
> > 
> > Very good, and thank you for your testing.  I have applied the requested
> > Reported-by and your Tested-by on the commit shown below.  Please let
> > me know if you would prefer some other Reported/Tested setup.
> > 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > commit 336e92638287615d47c07af4ff6feb397cfe2084
> > Author: Paul E. McKenney <paulmck@kernel.org>
> > Date:   Mon Jun 7 21:57:02 2021 -0700
> > 
> >      rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack
> >      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 to conserve stack space.
> >      Reported-by: kernel test robot <lkp@intel.com>
> >      Tested-by: Rong Chen <rong.a.chen@intel.com>
> >      Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> > 
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index 13bd8eee62bf..ef435aeac993 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
> >   /*
> >    * Initialize a new grace period.  Return false if no grace period required.
> >    */
> > -static bool rcu_gp_init(void)
> > +static noinline bool rcu_gp_init(void)
> 
> Small comment if it is not too late. noinline_for_stack expands to the same
> thing but is self documenting :) that way people do not have to git blame to
> see why these are marked as noinline (not that too many people are probably
> touching this but still).

How about like the following?

							Thanx, Paul

------------------------------------------------------------------------

commit 8aa0ceef4264012abd7b98d29f0a968f0f0046cb
Author: Paul E. McKenney <paulmck@kernel.org>
Date:   Mon Jun 7 21:57:02 2021 -0700

    rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack
    
    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.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Tested-by: Rong Chen <rong.a.chen@intel.com>
    [ paulmck: noinline_for_stack per Nathan Chancellor. ]
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 13bd8eee62bf..d8052adcdcb1 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
 /*
  * Initialize a new grace period.  Return false if no grace period required.
  */
-static bool rcu_gp_init(void)
+static noinline_for_stack bool rcu_gp_init(void)
 {
 	unsigned long firstseq;
 	unsigned long flags;
@@ -1931,7 +1931,7 @@ static void rcu_gp_fqs(bool first_time)
 /*
  * Loop doing repeated quiescent-state forcing until the grace period ends.
  */
-static void rcu_gp_fqs_loop(void)
+static noinline_for_stack void rcu_gp_fqs_loop(void)
 {
 	bool first_gp_fqs;
 	int gf = 0;

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-09  3:58             ` Paul E. McKenney
@ 2021-06-09  4:14               ` Nathan Chancellor
  2021-06-09 17:23                 ` Paul E. McKenney
  0 siblings, 1 reply; 11+ messages in thread
From: Nathan Chancellor @ 2021-06-09  4:14 UTC (permalink / raw)
  To: paulmck
  Cc: Rong Chen, kernel test robot, kbuild-all, clang-built-linux,
	linux-kernel

On 6/8/2021 8:58 PM, Paul E. McKenney wrote:
> On Tue, Jun 08, 2021 at 08:53:17AM -0700, Nathan Chancellor wrote:
>> On 6/7/2021 10:01 PM, Paul E. McKenney wrote:
>>> On Tue, Jun 08, 2021 at 11:14:40AM +0800, Rong Chen wrote:
>>>>
>>>>
>>>> On 6/7/21 11:19 PM, Paul E. McKenney wrote:
>>>>> On Mon, Jun 07, 2021 at 05:18:21PM +0800, Rong Chen wrote:
>>>>>>
>>>>>> On 6/6/21 12:49 PM, Paul E. McKenney wrote:
>>>>>>> On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
>>>>>>>> Hi Paul,
>>>>>>>>
>>>>>>>> FYI, the error/warning still remains.
>>>>>>>>
>>>>>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>>>>>> head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
>>>>>>>> commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
>>>>>>>> date:   5 months ago
>>>>>>>> config: powerpc-randconfig-r023-20210606 (attached as .config)
>>>>>>>> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
>>>>>>>> reproduce (this is a W=1 build):
>>>>>>>>             wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>>>>>>             chmod +x ~/bin/make.cross
>>>>>>>>             # install powerpc cross compiling tool for clang build
>>>>>>>>             # apt-get install binutils-powerpc-linux-gnu
>>>>>>>>             # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
>>>>>>>>             git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>>>>>>>             git fetch --no-tags linus master
>>>>>>>>             git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
>>>>>>>>             # save the attached .config to linux build tree
>>>>>>>>             COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
>>>>>>>>
>>>>>>>> If you fix the issue, kindly add following tag as appropriate
>>>>>>>> Reported-by: kernel test robot <lkp@intel.com>
>>>>>>>>
>>>>>>>> All warnings (new ones prefixed by >>):
>>>>>>>>
>>>>>>>>        In file included from kernel/rcu/tree.c:21:
>>>>>>>>        In file included from include/linux/kernel.h:12:
>>>>>>>>        In file included from include/linux/bitops.h:29:
>>>>>>>>        In file included from arch/powerpc/include/asm/bitops.h:62:
>>>>>>>>        arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
>>>>>>>>        #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
>>>>>>>>                ^
>>>>>>>>        <built-in>:310:9: note: previous definition is here
>>>>>>>>        #define __lwsync __builtin_ppc_lwsync
>>>>>>>>                ^
>>>>>>>>>> kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
>>>>>>>>        static int __noreturn rcu_gp_kthread(void *unused)
>>>>>>> Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
>>>>>>> for tracing") help?
>>>>>> Hi Paul,
>>>>>>
>>>>>> The stack frame size decreased to 2256 bytes:
>>>>>>
>>>>>>      kernel/rcu/tree.c:2129:23: warning: stack frame size of 2256 bytes in
>>>>>> function 'rcu_gp_kthread' [-Wframe-larger-than=]
>>>>> Very good, thank you!  Does the following patch (in addition to that
>>>>> commit) also help?
>>>>
>>>> Hi Paul,
>>>>
>>>> I applied the below patch on commit 2f20de99a63b and the warning is gone.
>>>
>>> Very good, and thank you for your testing.  I have applied the requested
>>> Reported-by and your Tested-by on the commit shown below.  Please let
>>> me know if you would prefer some other Reported/Tested setup.
>>>
>>> 							Thanx, Paul
>>>
>>> ------------------------------------------------------------------------
>>>
>>> commit 336e92638287615d47c07af4ff6feb397cfe2084
>>> Author: Paul E. McKenney <paulmck@kernel.org>
>>> Date:   Mon Jun 7 21:57:02 2021 -0700
>>>
>>>       rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack
>>>       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 to conserve stack space.
>>>       Reported-by: kernel test robot <lkp@intel.com>
>>>       Tested-by: Rong Chen <rong.a.chen@intel.com>
>>>       Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
>>>
>>> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
>>> index 13bd8eee62bf..ef435aeac993 100644
>>> --- a/kernel/rcu/tree.c
>>> +++ b/kernel/rcu/tree.c
>>> @@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
>>>    /*
>>>     * Initialize a new grace period.  Return false if no grace period required.
>>>     */
>>> -static bool rcu_gp_init(void)
>>> +static noinline bool rcu_gp_init(void)
>>
>> Small comment if it is not too late. noinline_for_stack expands to the same
>> thing but is self documenting :) that way people do not have to git blame to
>> see why these are marked as noinline (not that too many people are probably
>> touching this but still).
> 
> How about like the following?
> 
> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> commit 8aa0ceef4264012abd7b98d29f0a968f0f0046cb
> Author: Paul E. McKenney <paulmck@kernel.org>
> Date:   Mon Jun 7 21:57:02 2021 -0700
> 
>      rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack
>      
>      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.
>      
>      Reported-by: kernel test robot <lkp@intel.com>
>      Tested-by: Rong Chen <rong.a.chen@intel.com>
>      [ paulmck: noinline_for_stack per Nathan Chancellor. ]
>      Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

Thanks!

> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 13bd8eee62bf..d8052adcdcb1 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
>   /*
>    * Initialize a new grace period.  Return false if no grace period required.
>    */
> -static bool rcu_gp_init(void)
> +static noinline_for_stack bool rcu_gp_init(void)
>   {
>   	unsigned long firstseq;
>   	unsigned long flags;
> @@ -1931,7 +1931,7 @@ static void rcu_gp_fqs(bool first_time)
>   /*
>    * Loop doing repeated quiescent-state forcing until the grace period ends.
>    */
> -static void rcu_gp_fqs_loop(void)
> +static noinline_for_stack void rcu_gp_fqs_loop(void)
>   {
>   	bool first_gp_fqs;
>   	int gf = 0;
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread'
  2021-06-09  4:14               ` Nathan Chancellor
@ 2021-06-09 17:23                 ` Paul E. McKenney
  0 siblings, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2021-06-09 17:23 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Rong Chen, kernel test robot, kbuild-all, clang-built-linux,
	linux-kernel

On Tue, Jun 08, 2021 at 09:14:29PM -0700, Nathan Chancellor wrote:
> On 6/8/2021 8:58 PM, Paul E. McKenney wrote:
> > On Tue, Jun 08, 2021 at 08:53:17AM -0700, Nathan Chancellor wrote:
> > > On 6/7/2021 10:01 PM, Paul E. McKenney wrote:
> > > > On Tue, Jun 08, 2021 at 11:14:40AM +0800, Rong Chen wrote:
> > > > > 
> > > > > 
> > > > > On 6/7/21 11:19 PM, Paul E. McKenney wrote:
> > > > > > On Mon, Jun 07, 2021 at 05:18:21PM +0800, Rong Chen wrote:
> > > > > > > 
> > > > > > > On 6/6/21 12:49 PM, Paul E. McKenney wrote:
> > > > > > > > On Sun, Jun 06, 2021 at 12:19:57PM +0800, kernel test robot wrote:
> > > > > > > > > Hi Paul,
> > > > > > > > > 
> > > > > > > > > FYI, the error/warning still remains.
> > > > > > > > > 
> > > > > > > > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > > > > > > > > head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
> > > > > > > > > commit: 7dffe01765d9309b8bd5505503933ec0ec53d192 rcu: Add lockdep_assert_irqs_disabled() to raw_spin_unlock_rcu_node() macros
> > > > > > > > > date:   5 months ago
> > > > > > > > > config: powerpc-randconfig-r023-20210606 (attached as .config)
> > > > > > > > > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
> > > > > > > > > reproduce (this is a W=1 build):
> > > > > > > > >             wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > > > > > > > >             chmod +x ~/bin/make.cross
> > > > > > > > >             # install powerpc cross compiling tool for clang build
> > > > > > > > >             # apt-get install binutils-powerpc-linux-gnu
> > > > > > > > >             # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dffe01765d9309b8bd5505503933ec0ec53d192
> > > > > > > > >             git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > > > > > > >             git fetch --no-tags linus master
> > > > > > > > >             git checkout 7dffe01765d9309b8bd5505503933ec0ec53d192
> > > > > > > > >             # save the attached .config to linux build tree
> > > > > > > > >             COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
> > > > > > > > > 
> > > > > > > > > If you fix the issue, kindly add following tag as appropriate
> > > > > > > > > Reported-by: kernel test robot <lkp@intel.com>
> > > > > > > > > 
> > > > > > > > > All warnings (new ones prefixed by >>):
> > > > > > > > > 
> > > > > > > > >        In file included from kernel/rcu/tree.c:21:
> > > > > > > > >        In file included from include/linux/kernel.h:12:
> > > > > > > > >        In file included from include/linux/bitops.h:29:
> > > > > > > > >        In file included from arch/powerpc/include/asm/bitops.h:62:
> > > > > > > > >        arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
> > > > > > > > >        #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
> > > > > > > > >                ^
> > > > > > > > >        <built-in>:310:9: note: previous definition is here
> > > > > > > > >        #define __lwsync __builtin_ppc_lwsync
> > > > > > > > >                ^
> > > > > > > > > > > kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' [-Wframe-larger-than=]
> > > > > > > > >        static int __noreturn rcu_gp_kthread(void *unused)
> > > > > > > > Does -rcu commit 2f20de99a63b ("rcu: Make rcu_gp_cleanup() be noinline
> > > > > > > > for tracing") help?
> > > > > > > Hi Paul,
> > > > > > > 
> > > > > > > The stack frame size decreased to 2256 bytes:
> > > > > > > 
> > > > > > >      kernel/rcu/tree.c:2129:23: warning: stack frame size of 2256 bytes in
> > > > > > > function 'rcu_gp_kthread' [-Wframe-larger-than=]
> > > > > > Very good, thank you!  Does the following patch (in addition to that
> > > > > > commit) also help?
> > > > > 
> > > > > Hi Paul,
> > > > > 
> > > > > I applied the below patch on commit 2f20de99a63b and the warning is gone.
> > > > 
> > > > Very good, and thank you for your testing.  I have applied the requested
> > > > Reported-by and your Tested-by on the commit shown below.  Please let
> > > > me know if you would prefer some other Reported/Tested setup.
> > > > 
> > > > 							Thanx, Paul
> > > > 
> > > > ------------------------------------------------------------------------
> > > > 
> > > > commit 336e92638287615d47c07af4ff6feb397cfe2084
> > > > Author: Paul E. McKenney <paulmck@kernel.org>
> > > > Date:   Mon Jun 7 21:57:02 2021 -0700
> > > > 
> > > >       rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack
> > > >       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 to conserve stack space.
> > > >       Reported-by: kernel test robot <lkp@intel.com>
> > > >       Tested-by: Rong Chen <rong.a.chen@intel.com>
> > > >       Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> > > > 
> > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > > > index 13bd8eee62bf..ef435aeac993 100644
> > > > --- a/kernel/rcu/tree.c
> > > > +++ b/kernel/rcu/tree.c
> > > > @@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
> > > >    /*
> > > >     * Initialize a new grace period.  Return false if no grace period required.
> > > >     */
> > > > -static bool rcu_gp_init(void)
> > > > +static noinline bool rcu_gp_init(void)
> > > 
> > > Small comment if it is not too late. noinline_for_stack expands to the same
> > > thing but is self documenting :) that way people do not have to git blame to
> > > see why these are marked as noinline (not that too many people are probably
> > > touching this but still).
> > 
> > How about like the following?
> > 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > commit 8aa0ceef4264012abd7b98d29f0a968f0f0046cb
> > Author: Paul E. McKenney <paulmck@kernel.org>
> > Date:   Mon Jun 7 21:57:02 2021 -0700
> > 
> >      rcu: Make rcu_gp_init() and rcu_gp_fqs_loop noinline to conserve stack
> >      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.
> >      Reported-by: kernel test robot <lkp@intel.com>
> >      Tested-by: Rong Chen <rong.a.chen@intel.com>
> >      [ paulmck: noinline_for_stack per Nathan Chancellor. ]
> >      Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> 
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>

Applied, thank you!

							Thanx, Paul

> Thanks!
> 
> > 
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index 13bd8eee62bf..d8052adcdcb1 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -1737,7 +1737,7 @@ static void rcu_strict_gp_boundary(void *unused)
> >   /*
> >    * Initialize a new grace period.  Return false if no grace period required.
> >    */
> > -static bool rcu_gp_init(void)
> > +static noinline_for_stack bool rcu_gp_init(void)
> >   {
> >   	unsigned long firstseq;
> >   	unsigned long flags;
> > @@ -1931,7 +1931,7 @@ static void rcu_gp_fqs(bool first_time)
> >   /*
> >    * Loop doing repeated quiescent-state forcing until the grace period ends.
> >    */
> > -static void rcu_gp_fqs_loop(void)
> > +static noinline_for_stack void rcu_gp_fqs_loop(void)
> >   {
> >   	bool first_gp_fqs;
> >   	int gf = 0;
> > 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-06-09 17:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06  4:19 kernel/rcu/tree.c:2073:23: warning: stack frame size of 2704 bytes in function 'rcu_gp_kthread' kernel test robot
2021-06-06  4:49 ` Paul E. McKenney
2021-06-07  9:18   ` [kbuild-all] " Rong Chen
2021-06-07 15:19     ` Paul E. McKenney
2021-06-08  3:14       ` Rong Chen
2021-06-08  5:01         ` Paul E. McKenney
2021-06-08  5:34           ` Rong Chen
2021-06-08 15:53           ` Nathan Chancellor
2021-06-09  3:58             ` Paul E. McKenney
2021-06-09  4:14               ` Nathan Chancellor
2021-06-09 17:23                 ` Paul E. McKenney

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).