linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v3 1/4] cpumask: Fix invalid uniprocessor mask assumption
       [not found] <cc1f7d3334348cccbf9fde091015a802f379a9be.1654410109.git.sander@svanheule.net>
@ 2022-06-06  0:48 ` kernel test robot
  2022-06-06 10:40   ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2022-06-06  0:48 UTC (permalink / raw)
  To: Sander Vanheule, Peter Zijlstra, Yury Norov, Andrew Morton,
	Valentin Schneider, Thomas Gleixner, Greg Kroah-Hartman,
	Marco Elver
  Cc: kbuild-all, Linux Memory Management List, linux-kernel,
	Andy Shevchenko, Sander Vanheule

Hi Sander,

I love your patch! Yet something to improve:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v5.18 next-20220603]
[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]

url:    https://github.com/intel-lab-lkp/linux/commits/Sander-Vanheule/cpumask-Fix-invalid-uniprocessor-assumptions/20220606-004959
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
config: i386-randconfig-a009 (https://download.01.org/0day-ci/archive/20220606/202206060858.wA0FOzRy-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/37b3f10c4604ea299b454f39ac5ba3cad903ae16
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Sander-Vanheule/cpumask-Fix-invalid-uniprocessor-assumptions/20220606-004959
        git checkout 37b3f10c4604ea299b454f39ac5ba3cad903ae16
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   ld: arch/x86/kernel/cpu/cacheinfo.o: in function `__cache_amd_cpumap_setup':
   arch/x86/kernel/cpu/cacheinfo.c:890: undefined reference to `cpu_llc_shared_map'
>> ld: arch/x86/kernel/cpu/cacheinfo.c:895: undefined reference to `cpu_llc_shared_map'

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


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

* Re: [PATCH v3 1/4] cpumask: Fix invalid uniprocessor mask assumption
  2022-06-06  0:48 ` [PATCH v3 1/4] cpumask: Fix invalid uniprocessor mask assumption kernel test robot
@ 2022-06-06 10:40   ` Andy Shevchenko
  2022-06-08 17:59     ` Sander Vanheule
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2022-06-06 10:40 UTC (permalink / raw)
  To: kernel test robot
  Cc: Sander Vanheule, Peter Zijlstra, Yury Norov, Andrew Morton,
	Valentin Schneider, Thomas Gleixner, Greg Kroah-Hartman,
	Marco Elver, kbuild-all, Linux Memory Management List,
	linux-kernel

On Mon, Jun 06, 2022 at 08:48:05AM +0800, kernel test robot wrote:
> Hi Sander,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on akpm-mm/mm-everything]
> [also build test ERROR on linus/master v5.18 next-20220603]
> [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]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Sander-Vanheule/cpumask-Fix-invalid-uniprocessor-assumptions/20220606-004959
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> config: i386-randconfig-a009 (https://download.01.org/0day-ci/archive/20220606/202206060858.wA0FOzRy-lkp@intel.com/config)
> compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
> reproduce (this is a W=1 build):
>         # https://github.com/intel-lab-lkp/linux/commit/37b3f10c4604ea299b454f39ac5ba3cad903ae16
>         git remote add linux-review https://github.com/intel-lab-lkp/linux
>         git fetch --no-tags linux-review Sander-Vanheule/cpumask-Fix-invalid-uniprocessor-assumptions/20220606-004959
>         git checkout 37b3f10c4604ea299b454f39ac5ba3cad903ae16
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    ld: arch/x86/kernel/cpu/cacheinfo.o: in function `__cache_amd_cpumap_setup':
>    arch/x86/kernel/cpu/cacheinfo.c:890: undefined reference to `cpu_llc_shared_map'
> >> ld: arch/x86/kernel/cpu/cacheinfo.c:895: undefined reference to `cpu_llc_shared_map'

Seems like somewhere we need stubs for UP builds for those cache related functions.


-- 
With Best Regards,
Andy Shevchenko




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

* Re: [PATCH v3 1/4] cpumask: Fix invalid uniprocessor mask assumption
  2022-06-06 10:40   ` Andy Shevchenko
@ 2022-06-08 17:59     ` Sander Vanheule
  0 siblings, 0 replies; 3+ messages in thread
From: Sander Vanheule @ 2022-06-08 17:59 UTC (permalink / raw)
  To: Andy Shevchenko, kernel test robot
  Cc: Peter Zijlstra, Yury Norov, Andrew Morton, Valentin Schneider,
	Thomas Gleixner, Greg Kroah-Hartman, Marco Elver, kbuild-all,
	Linux Memory Management List, linux-kernel

On Mon, 2022-06-06 at 13:40 +0300, Andy Shevchenko wrote:
> On Mon, Jun 06, 2022 at 08:48:05AM +0800, kernel test robot wrote:
> > Hi Sander,
> > 
> > I love your patch! Yet something to improve:
> > 
> > [auto build test ERROR on akpm-mm/mm-everything]
> > [also build test ERROR on linus/master v5.18 next-20220603]
> > [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]
> > 
> > url:   
> > https://github.com/intel-lab-lkp/linux/commits/Sander-Vanheule/cpumask-Fix-invalid-uniprocessor-assumptions/20220606-004959
> > base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> > config: i386-randconfig-a009
> > (https://download.01.org/0day-ci/archive/20220606/202206060858.wA0FOzRy-lkp@intel.com/config)
> > compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
> > reproduce (this is a W=1 build):
> >         # https://github.com/intel-lab-lkp/linux/commit/37b3f10c4604ea299b454f39ac5ba3cad903ae16
> >         git remote add linux-review https://github.com/intel-lab-lkp/linux
> >         git fetch --no-tags linux-review Sander-Vanheule/cpumask-Fix-invalid-uniprocessor-
> > assumptions/20220606-004959
> >         git checkout 37b3f10c4604ea299b454f39ac5ba3cad903ae16
> >         # save the config file
> >         mkdir build_dir && cp config build_dir/.config
> >         make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
> > 
> > If you fix the issue, kindly add following tag where applicable
> > Reported-by: kernel test robot <lkp@intel.com>
> > 
> > All errors (new ones prefixed by >>):
> > 
> >    ld: arch/x86/kernel/cpu/cacheinfo.o: in function `__cache_amd_cpumap_setup':
> >    arch/x86/kernel/cpu/cacheinfo.c:890: undefined reference to `cpu_llc_shared_map'
> > > > ld: arch/x86/kernel/cpu/cacheinfo.c:895: undefined reference to `cpu_llc_shared_map'
> 
> Seems like somewhere we need stubs for UP builds for those cache related functions.
> 

I think I finally figured out what's going on here.

cpu_llc_shared_map is always declared with DECLARE_PER_CPU_READ_MOSTLY, but defined in
arch/x86/kernel/smpboot.c which only builds on CONFIG_SMP=y.

cpu_llc_shared_map is accessed in a for_each_cpu loop:
for_each_cpu(i, cpu_llc_shared_mask(cpu))

The old (wrong) UP implementation would ignore the mask, so cpu_llc_shared_map access was optimised
out and the linker would never see that symbol.

Adding a stub for the two inline functions in arch/x86/include/smp.h won't be sufficient I'm afraid.
But I think we can safely make the following assumptions (nobody complained before):
 * anything using cpumask_first_zero(), cpumask_next_zero(), and for_each_cpu_not() was expecting an
   empty mask on UP builds,
 * anything else would have expected a filled mask on UP builds.

I'll think about how to identify all the possible cases, but may not be able to spend a lot of time
on this in the two coming weeks. Any suggestions, or alternative solutions, are of course welcome.

Best,
Sander


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

end of thread, other threads:[~2022-06-08 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cc1f7d3334348cccbf9fde091015a802f379a9be.1654410109.git.sander@svanheule.net>
2022-06-06  0:48 ` [PATCH v3 1/4] cpumask: Fix invalid uniprocessor mask assumption kernel test robot
2022-06-06 10:40   ` Andy Shevchenko
2022-06-08 17:59     ` Sander Vanheule

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