Re: [PATCH 1/7] mm: allocate mm_cpumask dynamically based on nr_cpu_ids

From: kbuild test robot
Date: Wed Jun 20 2018 - 17:33:55 EST


Hi Rik,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v4.17]
[also build test ERROR on next-20180620]
[cannot apply to tip/x86/core linus/master mmotm/master v4.18-rc1]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Rik-van-Riel/x86-tlb-mm-make-lazy-TLB-mode-even-lazier/20180621-045620
config: x86_64-randconfig-x016-201824 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

Note: the linux-review/Rik-van-Riel/x86-tlb-mm-make-lazy-TLB-mode-even-lazier/20180621-045620 HEAD 7f2e7d915758c367dd0515efc17af977592fa141 builds fine.
It only hurts bisectibility.

All errors (new ones prefixed by >>):

>> mm/init-mm.c:38:1: error: Only string constants are supported as initializers for randomized structures with flexible arrays
};
^

vim +38 mm/init-mm.c

bb1f17b0 Alexey Dobriyan 2009-06-16 17
c59b389d Rik van Riel 2018-06-20 18 /*
c59b389d Rik van Riel 2018-06-20 19 * For dynamically allocated mm_structs, there is a dynamically sized cpumask
c59b389d Rik van Riel 2018-06-20 20 * at the end of the structure, the size of which depends on nr_cpu_ids. That
c59b389d Rik van Riel 2018-06-20 21 * way we allocate only as much memory for mm_cpumask() as needed for the
c59b389d Rik van Riel 2018-06-20 22 * hundreds, or thousands of processes that a system typically runs.
c59b389d Rik van Riel 2018-06-20 23 *
c59b389d Rik van Riel 2018-06-20 24 * Since there is only one init_mm in the entire system, keep it simple
c59b389d Rik van Riel 2018-06-20 25 * and size this cpu_bitmask to NR_CPUS.
c59b389d Rik van Riel 2018-06-20 26 */
bb1f17b0 Alexey Dobriyan 2009-06-16 27 struct mm_struct init_mm = {
bb1f17b0 Alexey Dobriyan 2009-06-16 28 .mm_rb = RB_ROOT,
bb1f17b0 Alexey Dobriyan 2009-06-16 29 .pgd = swapper_pg_dir,
bb1f17b0 Alexey Dobriyan 2009-06-16 30 .mm_users = ATOMIC_INIT(2),
bb1f17b0 Alexey Dobriyan 2009-06-16 31 .mm_count = ATOMIC_INIT(1),
bb1f17b0 Alexey Dobriyan 2009-06-16 32 .mmap_sem = __RWSEM_INITIALIZER(init_mm.mmap_sem),
bb1f17b0 Alexey Dobriyan 2009-06-16 33 .page_table_lock = __SPIN_LOCK_UNLOCKED(init_mm.page_table_lock),
bb1f17b0 Alexey Dobriyan 2009-06-16 34 .mmlist = LIST_HEAD_INIT(init_mm.mmlist),
bfedb589 Eric W. Biederman 2016-10-13 35 .user_ns = &init_user_ns,
c59b389d Rik van Riel 2018-06-20 36 .cpu_bitmap = { [BITS_TO_LONGS(NR_CPUS)] = 0},
a1b200e2 Heiko Carstens 2010-08-09 37 INIT_MM_CONTEXT(init_mm)
bb1f17b0 Alexey Dobriyan 2009-06-16 @38 };

:::::: The code at line 38 was first introduced by commit
:::::: bb1f17b0372de93758653ca3454bc0df18dc2e5c mm: consolidate init_mm definition

:::::: TO: Alexey Dobriyan <adobriyan@xxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip