hhoffstaette / kernel-patches

Custom Linux kernel patches
39 stars 7 forks source link

Compile error with 5.6.15 #14

Closed dirk-olmes closed 4 years ago

dirk-olmes commented 4 years ago

I emerged vanilla-sources:5.6.16, checked out the 5.6.15 tag and applied it. The compile fails with

  CC      arch/x86/kernel/cpu/bugs.o
In file included from ./include/linux/dev_printk.h:14,
                 from ./include/linux/device.h:15,
                 from ./include/linux/node.h:18,
                 from ./include/linux/cpu.h:17,
                 from mm/compaction.c:11:
In function ‘fragmentation_score_zone’,
    inlined from ‘fragmentation_score_node’ at mm/compaction.c:1894:12:
./include/linux/compiler.h:350:38: error: call to ‘__compiletime_assert_250’ declared with attribute error: BUILD_BUG failed
  350 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |                                      ^
./include/linux/compiler.h:331:4: note: in definition of macro ‘__compiletime_assert’
  331 |    prefix ## suffix();    \
      |    ^~~~~~
./include/linux/compiler.h:350:2: note: in expansion of macro ‘_compiletime_assert’
  350 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |  ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
   59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
      |                     ^~~~~~~~~~~~~~~~
./include/linux/huge_mm.h:284:28: note: in expansion of macro ‘BUILD_BUG’
  284 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
      |                            ^~~~~~~~~
./include/linux/huge_mm.h:78:26: note: in expansion of macro ‘HPAGE_PMD_SHIFT’
   78 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
      |                          ^~~~~~~~~~~~~~~
mm/compaction.c:1874:28: note: in expansion of macro ‘HPAGE_PMD_ORDER’
 1874 |    extfrag_for_order(zone, HPAGE_PMD_ORDER);
      |                            ^~~~~~~~~~~~~~~
In function ‘fragmentation_score_zone’,
    inlined from ‘__compact_finished’ at mm/compaction.c:1953:11,
    inlined from ‘compact_finished’ at mm/compaction.c:2033:8,
    inlined from ‘compact_zone’ at mm/compaction.c:2244:16:
./include/linux/compiler.h:350:38: error: call to ‘__compiletime_assert_250’ declared with attribute error: BUILD_BUG failed
  350 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |                                      ^
./include/linux/compiler.h:331:4: note: in definition of macro ‘__compiletime_assert’
  331 |    prefix ## suffix();    \
      |    ^~~~~~
./include/linux/compiler.h:350:2: note: in expansion of macro ‘_compiletime_assert’
  350 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |  ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
   59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
      |                     ^~~~~~~~~~~~~~~~
./include/linux/huge_mm.h:284:28: note: in expansion of macro ‘BUILD_BUG’
  284 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
      |                            ^~~~~~~~~
./include/linux/huge_mm.h:78:26: note: in expansion of macro ‘HPAGE_PMD_SHIFT’
   78 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
      |                          ^~~~~~~~~~~~~~~
mm/compaction.c:1874:28: note: in expansion of macro ‘HPAGE_PMD_ORDER’
 1874 |    extfrag_for_order(zone, HPAGE_PMD_ORDER);
      |                            ^~~~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:268: mm/compaction.o] Error 1
make: *** [Makefile:1695: mm] Error 2
make: *** Waiting for unfinished jobs....

full compile log: http://dpaste.com/30M5FZR

hhoffstaette commented 4 years ago

So this happens due to "mm: proactive compaction v5" and your kernel config without CONFIG_TRANSPARENT_HUGEPAGE. Quick fix is simply to turn it on (it should have been on by default!); I'll also report this upstream. The patch should figure this out and not fail the build.

hhoffstaette commented 4 years ago

Upstream bug report can be found here.

hhoffstaette commented 4 years ago

Fixed by upstream in 5.6.16/5.7.0. Thanks for reporting!