public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: "Leonardo Brás" <leobras@redhat.com>
To: kernel test robot <lkp@intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH v3 1/1] trace,smp: Add tracepoints around remotelly called functions
Date: Thu, 11 May 2023 02:13:02 -0300	[thread overview]
Message-ID: <e20ccacc00c93917686162e0e1f539fe8fda2dd1.camel@redhat.com> (raw)
In-Reply-To: <202305110816.mcNeYnWd-lkp@intel.com>

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	
> 


      reply	other threads:[~2023-05-11  5:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e20ccacc00c93917686162e0e1f539fe8fda2dd1.camel@redhat.com \
    --to=leobras@redhat.com \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox