public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [RFC PATCH v3 1/1] trace,smp: Add tracepoints around remotelly called functions
       [not found] <20230510230128.150384-1-leobras@redhat.com>
@ 2023-05-11  0:46 ` kernel test robot
  2023-05-11  5:13   ` Leonardo Brás
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-05-11  0:46 UTC (permalink / raw)
  To: Leonardo Bras; +Cc: llvm, oe-kbuild-all

Hi Leonardo,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.4-rc1 next-20230510]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Leonardo-Bras/trace-smp-Add-tracepoints-around-remotelly-called-functions/20230511-070554
base:   linus/master
patch link:    https://lore.kernel.org/r/20230510230128.150384-1-leobras%40redhat.com
patch subject: [RFC PATCH v3 1/1] trace,smp: Add tracepoints around remotelly called functions
config: riscv-buildonly-randconfig-r004-20230509 (https://download.01.org/0day-ci/archive/20230511/202305110816.mcNeYnWd-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project b0fb98227c90adf2536c9ad644a74d5e92961111)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/fcef1c202a1635b9c7244f06bbad605562b83d43
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Leonardo-Bras/trace-smp-Add-tracepoints-around-remotelly-called-functions/20230511-070554
        git checkout fcef1c202a1635b9c7244f06bbad605562b83d43
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202305110816.mcNeYnWd-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/smp.c:389:27: warning: passing 8-byte aligned argument to 32-byte aligned parameter 3 of 'csd_do_func' may result in an unaligned pointer access [-Walign-mismatch]
                   csd_do_func(func, info, csd);
                                           ^
   1 warning generated.


vim +/csd_do_func +389 kernel/smp.c

   369	
   370	/*
   371	 * Insert a previously allocated call_single_data_t element
   372	 * for execution on the given CPU. data must already have
   373	 * ->func, ->info, and ->flags set.
   374	 */
   375	static int generic_exec_single(int cpu, struct __call_single_data *csd)
   376	{
   377		if (cpu == smp_processor_id()) {
   378			smp_call_func_t func = csd->func;
   379			void *info = csd->info;
   380			unsigned long flags;
   381	
   382			/*
   383			 * We can unlock early even for the synchronous on-stack case,
   384			 * since we're doing this from the same CPU..
   385			 */
   386			csd_lock_record(csd);
   387			csd_unlock(csd);
   388			local_irq_save(flags);
 > 389			csd_do_func(func, info, csd);
   390			csd_lock_record(NULL);
   391			local_irq_restore(flags);
   392			return 0;
   393		}
   394	
   395		if ((unsigned)cpu >= nr_cpu_ids || !cpu_online(cpu)) {
   396			csd_unlock(csd);
   397			return -ENXIO;
   398		}
   399	
   400		__smp_call_single_queue(cpu, &csd->node.llist);
   401	
   402		return 0;
   403	}
   404	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

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

* Re: [RFC PATCH v3 1/1] trace,smp: Add tracepoints around remotelly called functions
  2023-05-11  0:46 ` [RFC PATCH v3 1/1] trace,smp: Add tracepoints around remotelly called functions kernel test robot
@ 2023-05-11  5:13   ` Leonardo Brás
  0 siblings, 0 replies; 2+ messages in thread
From: Leonardo Brás @ 2023-05-11  5:13 UTC (permalink / raw)
  To: kernel test robot; +Cc: llvm, oe-kbuild-all

On Thu, 2023-05-11 at 08:46 +0800, kernel test robot wrote:
> Hi Leonardo,
> 
> [This is a private test report for your RFC patch.]
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on linus/master]
> [also build test WARNING on v6.4-rc1 next-20230510]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Leonardo-Bras/trace-smp-Add-tracepoints-around-remotelly-called-functions/20230511-070554
> base:   linus/master
> patch link:    https://lore.kernel.org/r/20230510230128.150384-1-leobras%40redhat.com
> patch subject: [RFC PATCH v3 1/1] trace,smp: Add tracepoints around remotelly called functions
> config: riscv-buildonly-randconfig-r004-20230509 (https://download.01.org/0day-ci/archive/20230511/202305110816.mcNeYnWd-lkp@intel.com/config)
> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project b0fb98227c90adf2536c9ad644a74d5e92961111)
> 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 riscv cross compiling tool for clang build
>         # apt-get install binutils-riscv64-linux-gnu
>         # https://github.com/intel-lab-lkp/linux/commit/fcef1c202a1635b9c7244f06bbad605562b83d43
>         git remote add linux-review https://github.com/intel-lab-lkp/linux
>         git fetch --no-tags linux-review Leonardo-Bras/trace-smp-Add-tracepoints-around-remotelly-called-functions/20230511-070554
>         git checkout fcef1c202a1635b9c7244f06bbad605562b83d43
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv olddefconfig
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> > Reported-by: kernel test robot <lkp@intel.com>
> > Link: https://lore.kernel.org/oe-kbuild-all/202305110816.mcNeYnWd-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> > > kernel/smp.c:389:27: warning: passing 8-byte aligned argument to 32-byte aligned parameter 3 of 'csd_do_func' may result in an unaligned pointer access [-Walign-mismatch]
>                    csd_do_func(func, info, csd);
>                                            ^
>    1 warning generated.

Oh, ok, it makes sense.

On generic_exec_single(), the second parameter is a struct __call_single_data,
while csd_do_func() csd argument is a call_single_data_t.


In smp.h we have:

/* Use __aligned() to avoid to use 2 cache lines for 1 csd */
typedef struct __call_single_data call_single_data_t
	__aligned(sizeof(struct __call_single_data));


Which makes call_single_data_t 32-byte aligned, while struct __call_single_data
is 8-byte aligned in 64BIT.

Changing like this should fix the warning:
-csd_do_func(smp_call_func_t func, void *info, call_single_data_t *csd)
+csd_do_func(smp_call_func_t func, void *info, struct __call_single_data *csd)


I will send this on v4 shortly.


> 
> 
> vim +/csd_do_func +389 kernel/smp.c
> 
>    369	
>    370	/*
>    371	 * Insert a previously allocated call_single_data_t element
>    372	 * for execution on the given CPU. data must already have
>    373	 * ->func, ->info, and ->flags set.
>    374	 */
>    375	static int generic_exec_single(int cpu, struct __call_single_data *csd)
>    376	{
>    377		if (cpu == smp_processor_id()) {
>    378			smp_call_func_t func = csd->func;
>    379			void *info = csd->info;
>    380			unsigned long flags;
>    381	
>    382			/*
>    383			 * We can unlock early even for the synchronous on-stack case,
>    384			 * since we're doing this from the same CPU..
>    385			 */
>    386			csd_lock_record(csd);
>    387			csd_unlock(csd);
>    388			local_irq_save(flags);
>  > 389			csd_do_func(func, info, csd);
>    390			csd_lock_record(NULL);
>    391			local_irq_restore(flags);
>    392			return 0;
>    393		}
>    394	
>    395		if ((unsigned)cpu >= nr_cpu_ids || !cpu_online(cpu)) {
>    396			csd_unlock(csd);
>    397			return -ENXIO;
>    398		}
>    399	
>    400		__smp_call_single_queue(cpu, &csd->node.llist);
>    401	
>    402		return 0;
>    403	}
>    404	
> 


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

end of thread, other threads:[~2023-05-11  5:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230510230128.150384-1-leobras@redhat.com>
2023-05-11  0:46 ` [RFC PATCH v3 1/1] trace,smp: Add tracepoints around remotelly called functions kernel test robot
2023-05-11  5:13   ` Leonardo Brás

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