public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [norov:bitmap-tmp 7/8] arch/powerpc/xmon/xmon.c:472:64: error: expected ')' before 'return'
@ 2021-11-25 19:17 kernel test robot
  2021-11-25 19:43 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2021-11-25 19:17 UTC (permalink / raw)
  To: Yury Norov; +Cc: kbuild-all, linux-kernel

tree:   https://github.com/norov/linux bitmap-tmp
head:   75ee333c81c999b29a49810611fb160cec32217d
commit: 29f49f10b3fbef5a88db0a7e370984297616f0fa [7/8] lib/cpumask: replace cpumask_weight with cpumask_{empty,gt,le,eq}
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20211126/202111260340.kCOW9xsR-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 11.2.0
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
        # https://github.com/norov/linux/commit/29f49f10b3fbef5a88db0a7e370984297616f0fa
        git remote add norov https://github.com/norov/linux
        git fetch --no-tags norov bitmap-tmp
        git checkout 29f49f10b3fbef5a88db0a7e370984297616f0fa
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   arch/powerpc/xmon/xmon.c: In function 'wait_for_other_cpus':
>> arch/powerpc/xmon/xmon.c:472:64: error: expected ')' before 'return'
     472 |                 if (cpumask_weight_gt(&cpus_in_xmon, ncpus - 1)
         |                    ~                                           ^
         |                                                                )
     473 |                         return true;
         |                         ~~~~~~                                  
>> arch/powerpc/xmon/xmon.c:476:9: error: expected expression before '}' token
     476 |         }
         |         ^


vim +472 arch/powerpc/xmon/xmon.c

   465	
   466	static bool wait_for_other_cpus(int ncpus)
   467	{
   468		unsigned long timeout;
   469	
   470		/* We wait for 2s, which is a metric "little while" */
   471		for (timeout = 20000; timeout != 0; --timeout) {
 > 472			if (cpumask_weight_gt(&cpus_in_xmon, ncpus - 1)
   473				return true;
   474			udelay(100);
   475			barrier();
 > 476		}
   477	
   478		return false;
   479	}
   480	#else /* CONFIG_SMP */
   481	static inline void get_output_lock(void) {}
   482	static inline void release_output_lock(void) {}
   483	#endif
   484	

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

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

* Re: [norov:bitmap-tmp 7/8] arch/powerpc/xmon/xmon.c:472:64: error: expected ')' before 'return'
  2021-11-25 19:17 [norov:bitmap-tmp 7/8] arch/powerpc/xmon/xmon.c:472:64: error: expected ')' before 'return' kernel test robot
@ 2021-11-25 19:43 ` Joe Perches
  2021-11-26  2:54   ` Yury Norov
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2021-11-25 19:43 UTC (permalink / raw)
  To: kernel test robot, Yury Norov; +Cc: kbuild-all, linux-kernel

On Fri, 2021-11-26 at 03:17 +0800, kernel test robot wrote:
> tree:   https://github.com/norov/linux bitmap-tmp
> head:   75ee333c81c999b29a49810611fb160cec32217d
> commit: 29f49f10b3fbef5a88db0a7e370984297616f0fa [7/8] lib/cpumask: replace cpumask_weight with cpumask_{empty,gt,le,eq}
> config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20211126/202111260340.kCOW9xsR-lkp@intel.com/config)
> compiler: powerpc-linux-gcc (GCC) 11.2.0
> 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
>         # https://github.com/norov/linux/commit/29f49f10b3fbef5a88db0a7e370984297616f0fa
>         git remote add norov https://github.com/norov/linux
>         git fetch --no-tags norov bitmap-tmp
>         git checkout 29f49f10b3fbef5a88db0a7e370984297616f0fa
>         # save the config file to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    arch/powerpc/xmon/xmon.c: In function 'wait_for_other_cpus':
> > > arch/powerpc/xmon/xmon.c:472:64: error: expected ')' before 'return'
>      472 |                 if (cpumask_weight_gt(&cpus_in_xmon, ncpus - 1)
>          |                    ~                                           ^
>          |                                                                )
>      473 |                         return true;
>          |                         ~~~~~~                                  
> > > arch/powerpc/xmon/xmon.c:476:9: error: expected expression before '}' token
>      476 |         }
>          |         ^

It's always good to compile test patches before submitting them and:
 
> vim +472 arch/powerpc/xmon/xmon.c
> 
>    465	
>    466	static bool wait_for_other_cpus(int ncpus)
>    467	{
>    468		unsigned long timeout;
>    469	
>    470		/* We wait for 2s, which is a metric "little while" */
>    471		for (timeout = 20000; timeout != 0; --timeout) {
>  > 472			if (cpumask_weight_gt(&cpus_in_xmon, ncpus - 1)
>    473				return true;
>    474			udelay(100);

unrelated trivia:

It seeems this loop could consume a lot of cpu/power.

Could this use usleep_range() or maybe something else that doesn't allow
rescheduling on another cpu?

Maybe it should be something like

	unsigned long timeout = jiffies + msecs_to_jiffies(2000);

	while (time_before(jiffies, timeout)) {
		if (cpumask_weight_gt(&cpus_in_xmon, ncpus - 1)
				return true;
		usleep_range(100, 200);
	}



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

* Re: [norov:bitmap-tmp 7/8] arch/powerpc/xmon/xmon.c:472:64: error: expected ')' before 'return'
  2021-11-25 19:43 ` Joe Perches
@ 2021-11-26  2:54   ` Yury Norov
  0 siblings, 0 replies; 3+ messages in thread
From: Yury Norov @ 2021-11-26  2:54 UTC (permalink / raw)
  To: Joe Perches; +Cc: kernel test robot, kbuild-all, linux-kernel

On Thu, Nov 25, 2021 at 11:43:48AM -0800, Joe Perches wrote:
> On Fri, 2021-11-26 at 03:17 +0800, kernel test robot wrote:
> > tree:   https://github.com/norov/linux bitmap-tmp
> > head:   75ee333c81c999b29a49810611fb160cec32217d
> > commit: 29f49f10b3fbef5a88db0a7e370984297616f0fa [7/8] lib/cpumask: replace cpumask_weight with cpumask_{empty,gt,le,eq}
> > config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20211126/202111260340.kCOW9xsR-lkp@intel.com/config)
> > compiler: powerpc-linux-gcc (GCC) 11.2.0
> > 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
> >         # https://github.com/norov/linux/commit/29f49f10b3fbef5a88db0a7e370984297616f0fa
> >         git remote add norov https://github.com/norov/linux
> >         git fetch --no-tags norov bitmap-tmp
> >         git checkout 29f49f10b3fbef5a88db0a7e370984297616f0fa
> >         # save the config file to linux build tree
> >         mkdir build_dir
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash
> > 
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> > 
> > All errors (new ones prefixed by >>):
> > 
> >    arch/powerpc/xmon/xmon.c: In function 'wait_for_other_cpus':
> > > > arch/powerpc/xmon/xmon.c:472:64: error: expected ')' before 'return'
> >      472 |                 if (cpumask_weight_gt(&cpus_in_xmon, ncpus - 1)
> >          |                    ~                                           ^
> >          |                                                                )
> >      473 |                         return true;
> >          |                         ~~~~~~                                  
> > > > arch/powerpc/xmon/xmon.c:476:9: error: expected expression before '}' token
> >      476 |         }
> >          |         ^
> 
> It's always good to compile test patches before submitting them and:

As you can check, I didn't submit this patch. I pushed a series to my github,
and Intel 0-day bot tested it, and apparently found missed ')'.

I love this service, thank you Intel.
  
> > vim +472 arch/powerpc/xmon/xmon.c
> > 
> >    465	
> >    466	static bool wait_for_other_cpus(int ncpus)
> >    467	{
> >    468		unsigned long timeout;
> >    469	
> >    470		/* We wait for 2s, which is a metric "little while" */
> >    471		for (timeout = 20000; timeout != 0; --timeout) {
> >  > 472			if (cpumask_weight_gt(&cpus_in_xmon, ncpus - 1)
> >    473				return true;
> >    474			udelay(100);
> 
> unrelated trivia:
> 
> It seeems this loop could consume a lot of cpu/power.
> 
> Could this use usleep_range() or maybe something else that doesn't allow
> rescheduling on another cpu?
> 
> Maybe it should be something like
> 
> 	unsigned long timeout = jiffies + msecs_to_jiffies(2000);
> 
> 	while (time_before(jiffies, timeout)) {
> 		if (cpumask_weight_gt(&cpus_in_xmon, ncpus - 1)
> 				return true;
> 		usleep_range(100, 200);
> 	}
> 

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

end of thread, other threads:[~2021-11-26  3:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-25 19:17 [norov:bitmap-tmp 7/8] arch/powerpc/xmon/xmon.c:472:64: error: expected ')' before 'return' kernel test robot
2021-11-25 19:43 ` Joe Perches
2021-11-26  2:54   ` Yury Norov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox