lkml.org 
[lkml]   [2018]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/7] mm: allocate mm_cpumask dynamically based on nr_cpu_ids
From
Date
   I. On Sat, 2018-07-07 at 10:23 +0200, Mike Galbraith wrote:
> On Fri, 2018-07-06 at 17:56 -0400, Rik van Riel wrote:
> > The mm_struct always contains a cpumask bitmap, regardless of
> > CONFIG_CPUMASK_OFFSTACK. That means the first step can be to
> > simplify things, and simply have one bitmask at the end of the
> > mm_struct for the mm_cpumask.
>
> Otherwise virgin master.today grumbles.
>
> CC kernel/bounds.s
> UPD include/generated/timeconst.h
> UPD include/generated/bounds.h
> CC arch/x86/kernel/asm-offsets.s
> UPD include/generated/asm-offsets.h
> CALL scripts/checksyscalls.sh
> CHK include/generated/compile.h
> HOSTCC usr/gen_init_cpio
> UPD include/generated/compile.h
> CC init/main.o
> In file included from ./include/linux/cpumask.h:12:0,
> from ./arch/x86/include/asm/cpumask.h:5,
> from ./arch/x86/include/asm/msr.h:11,
> from ./arch/x86/include/asm/processor.h:21,
> from ./arch/x86/include/asm/cpufeature.h:5,
> from ./arch/x86/include/asm/thread_info.h:53,
> from ./include/linux/thread_info.h:38,
> from ./arch/x86/include/asm/preempt.h:7,
> from ./include/linux/preempt.h:81,
> from ./include/linux/spinlock.h:51,
> from ./include/linux/seqlock.h:36,
> from ./include/linux/time.h:6,
> from ./include/linux/stat.h:19,
> from ./include/linux/module.h:10,
> from init/main.c:16:
> In function ‘bitmap_zero’,
> inlined from ‘cpumask_clear’ at ./include/linux/cpumask.h:378:2,
> inlined from ‘mm_init_cpumask’ at
> ./include/linux/mm_types.h:504:2,
> inlined from ‘start_kernel’ at init/main.c:560:2:
> ./include/linux/bitmap.h:208:3: warning: ‘memset’ writing 64 bytes
> into a region of size 0 overflows the destination [-Wstringop-
> overflow=]
> memset(dst, 0, len);
> ^~~~~~~~~~~~~~~~~~~

I don't understand this one.

Inside init_mm we have this line:
.cpu_bitmap = { [BITS_TO_LONGS(NR_CPUS)] = 0},

which is the way the documentation suggests statically
allocated variable size arrays should be allocated
and initialized.

How does that result in a memset of the same size,
on the same array, to throw an error like above?

What am I doing wrong?

--
All Rights Reversed.[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-07-07 23:26    [W:0.049 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site